[Solved] I want to count frequency or occurrence of a every letter in a string C program
Ok here is the rewrite, the original code is better but this one might be easier to understand: #include <stdio.h> #include <string.h> int main() { char cur_char; char string[100]; int index = 0, count[255] = {0}; printf(“Enter a string\n”); gets(string); while (string[index] != ‘\0’) { char cur_char = string[index]; // cur_char is a char but … Read more