I need to write a program that reads a string from the keyboard and then outputs the number of occurrences of each letter in the alphabet as it pertains to the string. I also need to be able to count the number of words in the string. So far, here is the code I have come up with.
const int size=100;
char *sPtr = string;
cout <<"Enter a sentence of "<<size<<" characters or less to be analyzed.\n";
If anybody knows of a quick and easy way to accomplish this I would be eternally greatful. Yes this is a homework problem if anyone wonders, but I'm not looking for a handout. Thanks for everybody's help in advance!!!