Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <string>
- using namespace std;
- class A{
- public:
- static int a; // Static Variable
- //static function
- static int doPrint(){
- cout<<a;
- return 0;
- }
- };
- int A::a = 10;
- int main()
- {
- cout<<A::a;
- A::doPrint();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement