I have the following code, but it only reads lowercase letters. Ideally, it would read both upper and lower case letters and then store this info in an array. Any help or suggestions would be welcome.
Cheers.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are several problems with the code above but to answer your question directly, simply do some kind of check before incrementing the letterCount
IMPORTANT:
This is not initializing the array to zeros, its just setting the first item to zero then the rest are garbage.
to set the whole array to zero you have to iterate with a for loop and set each one to 0, manually type it out like {0, 0, 0, 26 times … }, or use memset() to clear it all at once.