今天在做题时遇到了两个问题:
1.error: too many initializers for 'char [6]';
2.error: initializer-string for array of chars is too long [-fpermissive]。
源代码:
#include <stdio.h>
int main()
{
char c[6] = {
"* * * * *",
" * * * * *",
" * * * * *",
" * * * * *",
" * * * * *",
"\0"
};
for (int i = 0; i < 5; i++) {
printf("\n",c[i]);
}
return 0;
}