I tried to understand the statement:
int main() {
fstream inf( \"ex.txt\", ios::in );
char c;
while( inf >> c ) {
What does ( inf >> c ) return in the while loop above?
void*
. The loop test resolves to while (inf.operator void*() != NULL)
.
How does a reference can be evaluated as true or false?
But supporting conversion to bool or something convertible to bool.
How does the internal implementation of istream actually work?
It just returns a reference to itself (return *this
) so it can support chaining.