太多的初始化对于char [9] [10] [英] Too many initializers for char[9][9]
本文介绍了太多的初始化对于char [9] [10]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
但事实是,有我声明的字符数组初始化中恰好量。
But the thing is, there are exactly the amount of initializers in the char array that I declared.
char dash[9][9]={
{"1","2","3","4","5","6","7","8","9"},
{"a","b","c","d","e","f","g","h","i"},
{"q","w","e","r","t","y","u","i","o"},
{"9","8","7","6","5","4","3","2","1"},
{"i","h","g","f","e","d","c","b","a"},
{"o","i","u","y","t","r","e","w","q"},
{"z","x","y","w","v","u","t","s","r"},
{"a","l","l","s","t","a","r","p","y"},
{"m","o","n","d","o","l","o","r","i"}
};
有九行九列的。什么是我的问题吗?我检查了其他论坛,这一次的答案,但没有发现任何帮助。
There are nine rows of nine columns. What's my problem? I checked other forums and this one for answers but found nothing that helped.
推荐答案
您正在使用的初始化字符串,而不是字符数组,这样每一个元素是试图以适应char和一个空终止符。尝试'1','2','3',等
You're initializing the array with strings, not chars, thus each element is trying to fit in the char and a null terminator. Try '1', '2', '3', etc.
这篇关于太多的初始化对于char [9] [10]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文