当前位置:大问百书>生活百科>c语言程序设计中出现too many initializers,怎么解决

c语言程序设计中出现too many initializers,怎么解决

2024-08-21 21:16:19 编辑:zane 浏览量:630

c语言程序设计中出现too many initializers,怎么解决

的有关信息介绍如下:

问题补充说明:编译c程序char str1[]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};出现C:\Documents and Settings\Administrator\Cpp1.cpp(5) : error C2078: too many initializers

c语言程序设计中出现too many initializers,怎么解决

因为str1[]只是一个字符串数组,而你对其给它赋了很多初始值,并且是字符串型的,所以会出现toomanyinitializers,定义一个字符串指针数组就可以解决,改正后为:char*str1[]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};

版权声明:文章由 大问百书 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.dawenbaishu.com/life/65957.html
热门文章