I'm reading characters out of a text file and printing them to the console via this code:
Here is what is actually in the text file:Code:ifstream textFile;
textFile.open(s.c_str(), ios::in);
char c = NULL;
while(!textFile.eof()) {
textFile >> c;
cout << c;
}
1234567890
This is what gets printed:
12345678900
Why does it print the last character twice? What can I do to avoid it?