counting letters from a file

I have a simple file of letters:
A
B
C
...
Z

1
2
3
4
5
6
7
8
9
while (!inFile.eof())
{
    for (int i = 0; i < 26; i++)
	{
		inFile >> letter[i];
		numLetters++;
	}
}
	


Now I know that this code is wrong, it counts all the newline characters as well as the letters, but how do I count just the letters?
Last edited on
You'd need to have some sort of a check to see if the character you just got is a letter or not and count it if it is.
Got it, just had to find the isalpha() function.
Topic archived. No new replies allowed.