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