fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3. class Point {
  4. public:
  5. Point() { cout << "\nNormal Constructor called"; }
  6. Point(const Point &t) { cout << "\nCopy constructor called"; }
  7. Point & operator=(const Point&t) { cout << "\nAssignment"; }
  8. };
  9. int main() {
  10. Point *t1, *t2;
  11. t1 = new Point();
  12. t2 = new Point(*t1);
  13. Point t3 = *t1;
  14. Point t4;
  15. t4 = t3;
  16. t4 = *t1;
  17. t4 = t3;
  18. // your code goes here
  19. return 0;
  20. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Normal Constructor called
Copy constructor called
Copy constructor called
Normal Constructor called
Assignment
Assignment
Assignment