ranjith kumar <ranjithproxy@xxxxxxxxx> writes: > Is this mailing list is for C questions only? No. > Can I ask a c++ question. Yes, with the proviso that this mailing list is really for questions about the use of gcc. It's not for general language question.s > using namespace std; > using std::ostream; > > class myostream > { > ostream &actual; > > public: > int on; > > myostream & operator <<(char *string) > { > if(on) > actual<<string; > return *this; > } > > } > int main() > { > myostream t; > t.on=1; > > t<<"HAI"; > } > > > When I tried to compile above program I got this compilation error. > > 1.cpp:2: error: ‘std::ostream’ has not been declared This error message seems straightforward enough. You have not declared std::ostream. This is normally done via #include <ostream> This kind of question is better asked on a mailing list about the C++ language, not one about gcc. Ian