开发者

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜