Need to write a program that displays the number of letters that are stored in a file, but I have no idea how to and haven't been able to find a way online. It seems very simple but I just don't know what to do.
It reads non-blank characters one-by-one from an input filestream named 'in' (which you will have previously attached to a file) and, if they are alphabetic, increments a counter.
It will stop the loop when the filestream tests as 'bad' (because it has run out of characters).
YOU have to write about five or six not-very-exciting lines of code around that to:
- open the filestream
- declare c as char
- declare counter as an int and initialise it to 0