Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class K
  5. {
  6. int a;
  7. public:
  8. K(int x) { a = x; };
  9. void print() { cout << " a is: " << a << endl; };
  10. };
  11.  
  12. class G
  13. {
  14. public:
  15. static K ob1;
  16. static void printG()
  17. {
  18. ob1.print();
  19. };
  20. };
  21.  
  22. int main()
  23. {
  24. K o1(10);
  25. G::printG();
  26. system("pause");
  27. }
  28.  
  29. K G::ob1;
  30. int main(){ .... }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement