I am reading an introductory book on C++. In that there is an example program on opening a file.
The code is as follows...
#include<iostream.h>
#include<fstream.h>
void main()
{
ifstream fin;
fin.open("country");
while(fin)
{
....
.....
}
}
Here is my doubt. In the code the author says that,fin will evaluate to 0 if there are any errors in the file operation(including end-of-file condition).In this case how can an object be evaluated to an integer(i.e. 0. Or Some-non zero)?