ERROR: expected expression before "{"
The second line in the function triggers the error.
void read_word(int counts[25])
{
counts[25]={0};
int b;
char a;
scanf("%c", &a);
while(isalpha(a) )
{
开发者_Python百科 b= a -97;
counts[b]++;
scanf("%c", &a);
}
}
You cannot initialize the array not during declaration: (counts[25]={0};
).
Also, this: void read_word(int counts[25])
is treated as void read_word(int *counts)
which means the compiler will not know what is the size of the array...
精彩评论