Skip to content

Instantly share code, notes, and snippets.

@adaam
Created January 12, 2015 07:41
Show Gist options
  • Save adaam/b41903f7561e2be37fc3 to your computer and use it in GitHub Desktop.
Save adaam/b41903f7561e2be37fc3 to your computer and use it in GitHub Desktop.
demo c++ class
#include<iostream>
using namespace std;
class a {
public:
int getb(void){ return b;};
private:
static const int b = 10;
};
int main(void){
a *p=new a();
cout << p->getb();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment