编译提醒deprecated conversion from string constant to 'char*''
编译提示deprecated conversion from string constant to 'char*''?
我在结构体中定义的是:
struct Node
{
char Section[32];
};
然后
printf("%s\n",Section);
编译器会提示:
deprecated conversion from string constant to 'char*''
请问这个该怎么修改?
谢谢!
------解决方案--------------------
deprecated conversion from string constant to 'char*''
常量字符串变量不能强制变成字符指针
------解决方案--------------------
那你们公司够水的。。。
------解决方案--------------------
我在结构体中定义的是:
struct Node
{
char Section[32];
};
然后
printf("%s\n",Section);
编译器会提示:
deprecated conversion from string constant to 'char*''
请问这个该怎么修改?
谢谢!
------解决方案--------------------
deprecated conversion from string constant to 'char*''
常量字符串变量不能强制变成字符指针
------解决方案--------------------
那你们公司够水的。。。
------解决方案--------------------
char* p = "hello world"; // convert string const to char*
char const* cstr = "looks great"; //OK