cout << flush not working in my class that derives from fstream
Posted on 2003-03-25
Normally when I prompt the user for input I flush the buffer, and it works fine:
cout << "Enter path to input file: " << flush;
But now I'm trying to do the same thing in a class_name.cpp file and I get:
error C2679: binary '<<' : no operator defined which takes a right-hand
operand of type '' (or there is no acceptable conversion)
In the class_name.h file I do this to inherit from fstream:
class class_name:public fstream
If I remove the flush keyword it works fine. And, kinda weird, but the endl keyword also works fine.
I do have this in class_name.cpp:
Why does flush bomb out?