Advertisement
ejdier

destruktor 190214

Feb 19th, 2014
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. class Test
  4. {
  5. public:
  6.     Test()
  7.     {
  8.     cout <<"Konstruktor"<<endl;
  9.     }
  10.     Test (Test & o)
  11.     {
  12.      cout <<"Konstruktor kopiujacy" << endl;
  13.     }
  14.     ~Test()
  15.     {
  16.      cout<<"Destruktor"<<endl;
  17.     }
  18. };
  19.  
  20. int main()
  21. {
  22.  {
  23.   Test t;
  24.  }
  25.   cout << "---"<<endl;
  26.  {
  27.  Test t1;
  28.  Test t2(t1);
  29.  }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement