Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Brain {
- public:
- Brain ();
- ~Brain ();
- private:
- string endorphines;;
- };
- Brain::Brain () {
- endorphines = "tragically beautiful";
- }
- Brain::~Brain () {
- cout << endorphines;
- }
- int main () {
- Brain b;
- return 0;
- }
- //This is a class going out of scope while calling it’s destructor.
- //Before it dies, it’s destructor releases all the resources that
- //would otherwise hog a range of resources. Tragically beautiful.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement