Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Calc {
  6. int wrong;
  7. public:
  8. Calc(int wrong)
  9. {
  10. this->wrong = wrong;
  11. cout << "Init\n";
  12. }
  13. ~Calc()
  14. {
  15. cout << "Destroy!\n";
  16. }
  17.  
  18. void test()
  19. {
  20. cout << wrong << "\n";
  21. }
  22.  
  23. };
  24.  
  25. int main() {
  26. Calc* calc = new Calc(2);
  27.  
  28. calc->test();
  29.  
  30. delete calc;
  31. /* delete anroper deconstructor.*/
  32. system ("pause");
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement