fork(6) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Test
  5. {
  6. public:
  7. Test() { cout << "default constructor" << endl; }
  8. Test(const Test &) { cout << "copy constructor" << endl; }
  9. Test& operator = (const Test &) { cout << "operator =" << endl; return *this; }
  10. };
  11.  
  12. int main()
  13. {
  14. Test t1;
  15. Test t2 = t1;
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
default constructor
copy constructor