fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class MyClass {
  5. public:
  6. int i;
  7. MyClass & operator<< ( const string & );
  8. } ;
  9.  
  10. MyClass& MyClass::operator<< ( const string & str) {
  11. cout << str << endl ;
  12. return *this;
  13. }
  14.  
  15. int main() {
  16. MyClass mc;
  17.  
  18. mc << "hello" << "world" ;
  19. }
  20.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
hello
world