I have the following macro
I want to print a variable name then the value, so the macro will help having the variable name to show then its value
the result of my example show
var = 1.234
printed on the screen.
#include <stdio.h>
#define str(s) #s
#define PRINTER(X) printf("% 12s = % f\n", str(X), X);
int main()
{
float var = 1.234f;
PRINTER(var);// <===== warning here
return EXIT_SUCCESS;
}
my question, if you try it, let me know if you get a warning within main, and what it mean??
for me I get flag ` ' used with type `s'
edit:
flag description
(space) If no sign is going to be written, a blank space is inserted before the value.