Advertisement
konalisp

Tragically_Beautiful.cxx

Oct 10th, 2014
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Brain {
  6. public:
  7.      Brain ();
  8.     ~Brain ();
  9. private:
  10.     string endorphines;;
  11. };
  12.  
  13. Brain::Brain () {
  14.     endorphines = "tragically beautiful";
  15. }
  16.  
  17. Brain::~Brain () {
  18.     cout << endorphines;
  19. }
  20.  
  21. int main () {
  22.     Brain b;
  23.     return 0;
  24. }
  25.  
  26. //This is a class going out of scope while calling it’s destructor.
  27. //Before it dies, it’s destructor releases all the resources that
  28. //would otherwise hog a range of resources. Tragically beautiful.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement