c - "initialization makes integer from pointer without a cast"数组初始化中逐渐减弱

标签 c arrays pointers char compiler-warnings

我现在开始学习C。我想知道为什么我会收到警告。我声明了一个二维char数组,但是为什么不允许使用字符“d”

char array[3][3] = {{1,"d",3},{3,2,1},{2,1,3}};

最佳答案

将“d”替换为“d”

“d”是一个字符

“d”是一个字符串

关于c - "initialization makes integer from pointer without a cast"数组初始化中逐渐减弱,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30534329/

相关文章:

c++ - 来自数组指针的正确语法访问值?

c - 从函数返回数组/指针

c - 在 C 中的 for 循环和 if 语句中使用 Malloc 数组 - 导致分段

c++ - 从 vi "like running cpp program without exiting vi."运行各种 c 或 cpp 开发任务

javascript - 在 Javascript 中递减数组长度

pointers - (Think) Pascal 中指向指针的指针和 NewHandle 函数

c - 骑士之旅无限循环

iOS Swift 将 GPS 坐标存储到数组中

arrays - 如何将字符数组传递给字符串

C++类指针删除段错误