c++: use a #define in printf?
- by John
I was wanting to use a constant of some kind for the application ID (so I can use it in printf).
I had this:
#define _APPID_ "Hello World!"
And then the simple printf, calling it into %s (string). It put this out:
simple.cpp:32: error: cannot convert ‘_IO_FILE*’ to ‘const char*’ for argument ‘1’ to ‘int printf(const char*, ...)’
What would I use to define the application ID to use in printf? I tried:
static const char _APPID_[] = "Hello World"`
but it didn't work, same error I think.