int main (){
char string[100];
int c=0,count[26]={0},x;
gets(string);
while(string[c]!='\0'){
if (string[c] >= 'a' && string[c] <= 'z') {
x = string[c] - 'a';
count[x]++;
}
c++;
}
for (c = 0; c < 26; c++){
printf("%c occurs %d times in the string.\n", c + 'a', count[c]);
}
return 0;
}
Firstly, it gives me this error about get: warning: implicit declaration of function ‘gets’; did you mean ‘fgets’? [-Wimplicit-function-declaration] gets(string); And I don't know why doesn't work, although it makes sense.