basic fstream question
I'm in a second year C++ class and using MS Visual C++ as my compiler. My question is- when reading a file with ifstream, and using a loop to count words and characters what should I use to end the loop? I have it set like this, each character of the input file is being put into a temp variable, ch, and counted. <BR>do{<BR> mycode<BR>}while(ch != 'EOF') This isn't working (of course) So what is the correct syntax to end a loop at the end of a file?
|