我想要为应用程序ID使用某种常量(所以我可以在printf中使用它).
我有这个:
#define _APPID_ "Hello World!"
Run Code Online (Sandbox Code Playgroud)
然后是简单的printf,将其调用为%s(字符串).它说出来了:
simple.cpp:32: error: cannot convert ‘_IO_FILE*’ to ‘const char*’ for argument ‘1’ to ‘int printf(const char*, ...)’
我将使用什么来定义要在printf中使用的应用程序ID?我试过了:
static const char _APPID_[] = "Hello World"`
Run Code Online (Sandbox Code Playgroud)
但它没有用,我认为同样的错误.