A few questions about legal arguments to printf(“%s”, …)
问题 I'm creating a modified printf implementation, and I'm not sure about the answers to these questions. Does zero work as a null string? (Is printf("%s", 0) allowed?) I'm guessing no, because 0 is an int . But then this prompts this question: Does NULL work as a null string? (Is printf("%s", NULL) allowed?) Logically, I think it should be yes, because NULL implies a pointer; but a lot of implementations seem to have #define NULL 0 , so I feel in practice it might be no. Which is correct? Does