I came across this code which deals with a simple reading of a file and displaying its contents.
#include <iostream>
#include <fstream>
int main()
{
...
fstream file;
file.open("TEXT.txt", ios::in);
file.seekg(0);
while(file) //does file returns 0 when eof is reached?
{
file.get(ch);
cout << ch;
}
return 0;
}
My question is how does while (file)
realizes that the end of the file has been reached.