2 ms·
For non-variadic functions, the argument is implicitly converted to the parameter type (if possible). For variadic functions, the compiler doesn't know the par
by _kst_ 7y ago
For non-variadic functions, the argument is implicitly converted to the parameter type (if possible).
For variadic functions, the compiler doesn't know the parameter type.
So to print a null pointer, you need to do this:
printf("NULL = %p\n", (void*)NULL);
or
printf("null pointer = %p\n", (void*)0);
The %p format requires an argument of type void*, so you have to convert to that type if necessary.