...
When using printf(const char *format, ...)
or its variants, string literals should be used for the format
parameter as opposed to a string char *
variable.
Code Block | ||
---|---|---|
| ||
int value = 1; // Good printf("Value is %d", value); // Bad const char* const format = "Value is %d"; printf(format, value); |
...