Each character has a numeric value. 'A'=65, 'B'=66, 'a'=97, etc. There are 256 possible values.
So read a character. Use the character as an index into stAlphabet[256] and increment that value. When you hit the EOF, you will have the count of all characters in the file.
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37
Yeah, it's quite impossible after collecting all the letter counts to figure out how to combine the counts for 'a' and 'A'...
(i wish we still had the roll-eyes -- i like to mark sarcasm in case Sheldon Cooper is reading this...)
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37
I think you've missed WaltP's point, which was that the counts for each upper and lower case value could simply be added together after the fact.
Schol-R-LEA
Veteran Poster
1,089 posts since Oct 2010
Reputation Points: 495
Solved Threads: 173
Skill Endorsements: 13
didn't i just say that he needs to do it, where did i say it is not possible ? ?
Sorry, Sokurenko, if that's what you meant. The way it reads is by calculating all the values and he only needs 'A' and 'a' added my suggestion is cumbersome and prone to not working.
But then again, isn't it obvious? I'm somewhat old school and rather than tell people book:chapter:verse:word, I give them basic information and allow them to think about how to implement it. I wanted reyesg to figure the addition out himself...
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37