Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagec
int value = 1;

// Good
printf("Value is %d", value);

// Bad
const char* const format = "Value is %d";
printf(format, value);

...