title: Access non static data member outside class
body: <p>Is it possible to access non static data members outside their class? Say you have an example like the following. I know it does not make much sense as an example, but I just want to understand how to access a non static data member. If the following is compiled it generates an error:</p>
  
  <pre><code> C.h|70|error: invalid use of non-static data member ‘C::age’|
  </code></pre>
  
  <p>//C.h</p>
  
  <pre><code>class C{
    public:
      int age;
  };
   int getAge();
  </code></pre>
  
  <p>//C.cpp</p>
  
  <pre><code>C::C()
  {
      age  = 0;
  }
  int getAge(){
     return (C::age);
  }
  </code></pre>