Advertisement
bhok

C++ deconstructors

Sep 24th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. // More C++ Tutorial at BrandonHok.com
  2.  
  3. #include <iostream>
  4.  
  5. // This can be done in cpp.sh
  6.  
  7. class FireFuse
  8. {
  9. public:
  10.     // Start with a default constructor
  11.     FireFuse(int sec = 10);
  12.     ~FireFuse();
  13. };
  14.  
  15. FireFuse::FireFuse(int sec)
  16. {
  17.     std::cout << "FireFuse()\n";
  18. }
  19.  
  20. FireFuse::~FireFuse()
  21. {
  22.     std::cout << "~FireFuse()\n";
  23. }
  24.  
  25. int main()
  26. {
  27.     FireFuse timer;
  28.     FireFuse array[10];
  29.     array[1] = timer;
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement