comma (,) in C Macro Definition
问题 I've never seen this syntax before. #define SNS(s) (s),(sizeof(s)-1) The way i'm reading this is that SNS(s) = sizeof(s)-1 . What is the comma doing? Is it necessary? int ft_display_fatal(const char *err, unsigned len, int fd, int rcode) { UNUSED(write(fd, err, len)); return (rcode); } Main return (ft_display_fatal(SNS("File name missing.\n"), 2, 1)); 回答1: Macros are just text replacement, so they can expand to just about anything you want. In this case, the macro is being used to expand into