Created
January 18, 2012 16:53
-
-
Save sinannar/1634011 to your computer and use it in GitHub Desktop.
If you have some trouble with const and dest when they called,try it
This file contains hidden or 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> | |
using namespace std; | |
#define POINTER_CREATION | |
#define REAL_CREATION | |
class Aaa{ | |
public: | |
Aaa() | |
{ | |
cout<<"CONSTRUCTOR"<<endl; | |
} | |
~Aaa() | |
{ | |
cout<<"DESTRUCTOR"<<endl; | |
} | |
}; | |
int main(void) | |
{ | |
cout<<"1"<<endl; | |
#ifdef REAL_CREATION | |
Aaa a; | |
#endif | |
#ifdef POINTER_CREATION | |
Aaa *b; | |
#endif | |
cout<<"2"<<endl; | |
cout<<"3"<<endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment