char month_name[N]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"};error C2078:too many initializers执行 cl.exe 时出错.为什么?难道是超过字符数组的容量?
来源:学生作业帮助网 编辑:作业帮 时间:2024/09/04 20:39:05
char month_name[N]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"};error C2078:too many initializers执行 cl.exe 时出错.为什么?难道是超过字符数组的容量?
char month_name[N]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"};
error C2078:too many initializers
执行 cl.exe 时出错.
为什么?难道是超过字符数组的容量?
char month_name[N]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"};error C2078:too many initializers执行 cl.exe 时出错.为什么?难道是超过字符数组的容量?
char month_name[N]
改成
char *month_name[N]
数组里的每一个元素是字符串,不是字符.所以应该是char *