Skip to content

Instantly share code, notes, and snippets.

@sinannar
Created January 18, 2012 16:53
Show Gist options
  • Save sinannar/1634011 to your computer and use it in GitHub Desktop.
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
#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