#include #include #include using namespace std ; class mycout { public: static string myendl ; mycout& operator<<( int& x1) { printf ( "%d" , x1 ) ; return ( *this ) ; } mycout& operator<<(const char* str1) { printf ( "%s" , str1 ) ; return ( *this ) ; } mycout& operator<<(string& str1) { printf ( "%s" , str1.c_str() ) ; return ( *this ) ; } }; string mycout::myendl = "\n" ; int main() { int x1 = 0 ; mycout obj1 ; string str1 = "Another String" ; obj1 << x1 << " Test some string\n" ; obj1 << str1 ; obj1 << mycout::myendl << mycout::myendl ; return 0; }