I have this program that counts characters in a string is there a way to modify this code so that for example it counts specific characters entered. Exmaple.. user entered Hello, and I wanted the program to say there are 2 "L"''s entered in that word. THanks for your help!
#include <stdio.h>
#define MAXNUM 15
int countchar (char []);
int main()
{
char message [MAXNUM];
int numchar;
printf("\nType in a word: ");
gets(message);
numchar = countchar (message);
printf ("The number of characters entered is %d\n", numchar);
return 0;
} // END OF MAIN
//FUNCTION IMPLEMENTATION
int countchar (char list[])
{
int i, count = 0;
for (i = 0; list[i] != '\0'; i++)
count++;
return (count);
}