fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Point1 {
  5. public:
  6. int x;
  7. int y;
  8.  
  9. Point1(int x, int y);
  10. ~Point1();
  11. };
  12.  
  13. Point1::Point1(int x1, int y1) {
  14. x = x1;
  15. y = y1;
  16. cout << "criou" << endl; //estou deixando só para fins didáticos
  17. }
  18.  
  19. Point1::~Point1() {
  20. cout << "destruiu " << x << " " << y << endl; //para fins de debug
  21. }
  22.  
  23. int main() {
  24. Point1 C(1, 4);
  25. cout << C.x << endl;
  26. cout << C.y << endl;
  27. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
criou
1
4
destruiu 1 4