问题描述
|
函数的第二行触发错误。
void read_word(int counts[25])
{
counts[25]={0};
int b;
char a;
scanf(\"%c\",&a);
while(isalpha(a) )
{
b= a -97;
counts[b]++;
scanf(\"%c\",&a);
}
}
解决方法
您不能在声明期间不初始化数组:(
counts[25]={0};
)。
同样,这:void read_word(int counts[25])
被视为void read_word(int *counts)
,这意味着编译器将不知道数组的大小是多少...