Advertisement
Guest User

example for stackoverflow question

a guest
Mar 17th, 2013
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. class C{
  4. public:
  5.     static int age;
  6. };
  7.  
  8. int C::age = 1;
  9.  
  10. int getAge();
  11.  
  12.  
  13. int getAge(){
  14.     return (C::age);
  15. }
  16.  
  17.  
  18. int main()
  19. {
  20.     std::cout << getAge() << std::endl;
  21.    
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement