|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 林江楠 于 2021-11-25 10:12 编辑
- #include <stdio.h>
- int main()
- {
- char *p1[5] = {
- "让编程改变世界 -- 鱼C工作室",
- "Just do it -- NIKE",
- "一切皆有可能 -- 李宁",
- "永不止步 -- 安踏",
- "One more thing... -- 苹果"
- };
- int i;
- for (i = 0; i < 5; i++)
- {
- printf("%s\n", p1[i]);
- }
- return 0;
- }
- [fishc@localhost s1e23]$ gcc test3.c && ./a.out
复制代码
我的编译器警告了,就在定义指针数组那里,咋回事
D:\桌面\未命名8.cpp In function 'int main()':
11 9 D:\桌面\未命名8.cpp [Warning] deprecated conversion from string constant to 'char*' [-Wwrite-strings]
11 9 D:\桌面\未命名8.cpp [Warning] deprecated conversion from string constant to 'char*' [-Wwrite-strings]
11 9 D:\桌面\未命名8.cpp [Warning] deprecated conversion from string constant to 'char*' [-Wwrite-strings]
11 9 D:\桌面\未命名8.cpp [Warning] deprecated conversion from string constant to 'char*' [-Wwrite-strings]
11 9 D:\桌面\未命名8.cpp [Warning] deprecated conversion from string constant to 'char*' [-Wwrite-strings]
|
|