B
barcaroller
I was looking at some code that uses fstream:
#include <fstream>
//
// which includes:
// istream& getline( char* buffer, streamsize num );
//
ifstream fin;
while( fin.getline(line, size) ) {
...
}
If fin.getline() returns a reference, how could it be used in a conditional
statement? I've looked at the member functions and I could not find a
conversion to a bool type.
#include <fstream>
//
// which includes:
// istream& getline( char* buffer, streamsize num );
//
ifstream fin;
while( fin.getline(line, size) ) {
...
}
If fin.getline() returns a reference, how could it be used in a conditional
statement? I've looked at the member functions and I could not find a
conversion to a bool type.