I\'m attempting to learn C and already I\'ve run into an issue. I assume its trivial but I need to know it. I have written:
#include
#include
The warning is caused by the compiler wanting the first argument of printf
to be a string literal. It wants you to write this:
printf("%s\n", str_a);
This is because the first parameter of printf
is the format string. The format arguments are then passed after that.
Note: You can in fact use a variable as a format string, but you probably shouldn't do that. That's why the compiler issues a warning and not an error.