Your program has an error. You have not defined the program correctly.

Here is the program to count all the strings in an array
Code: C
#define SLENGTH 26

int main()
{
    int i;
    char word[SLENGTH];
    int count[SLENGTH] = {0};
    printf("Please enter a string: ");

    scanf("%s", word);
    for(i = 0; i < SLENGTH && word[i] != '\0'; i++)
    {
        word[i] = tolower(word[i]);
        count[word[i]-'a']++;
    }
    for(i = 0; i < SLENGTH; i++)
    {
        if(count[i] != 0)
            printf("The letter %c appeared %d times\n", i+'a', count[i]);
    }
    getch();
}