Created
September 19, 2016 05:45
-
-
Save norbekaiser/4e3f97f20cf065c13328bd4e24b1e35f to your computer and use it in GitHub Desktop.
delete this , "meh"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Huhu gone | |
h1 ex | |
h2 ex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class hue{ | |
public: | |
hue(){ | |
}; | |
~hue() { std::cout << "Hue gone"<<std::endl; } | |
}; | |
class huhu{ | |
public: | |
huhu(){ | |
delete this; | |
return; | |
}; | |
~huhu() { std::cout << "Huhu gone"<<std::endl; } | |
}; | |
int main(){ | |
using namespace std; | |
hue* h1 = new hue(); | |
huhu* h2 = new huhu(); | |
if(h1){ cout<< "h1 ex"<< endl;; } | |
else { cerr<<"h1 nex"<<endl; } | |
if(h2){ cout<< "h2 ex"<< endl;; } | |
else { cerr<<"h2 nex"<<endl; } | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment