Created
January 12, 2015 07:41
-
-
Save adaam/b41903f7561e2be37fc3 to your computer and use it in GitHub Desktop.
demo c++ class
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> | |
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