Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class K
- {
- int a;
- public:
- K(int x) { a = x; };
- void print() { cout << " a is: " << a << endl; };
- };
- class G
- {
- public:
- static K ob1;
- static void printG()
- {
- ob1.print();
- };
- };
- int main()
- {
- K o1(10);
- G::printG();
- system("pause");
- }
- K G::ob1;
- int main(){ .... }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement