title: How to access a member variable without instantiation, C++
body: <p>Suppose I have class B which gets a value 'v' in the constructor from another class A. How can I read this value from class C?
  Class C will be instantiated on demand, but A has created B and passed the 'v' already. 'v' will change in every instantiation.  I have tried to make 'v' static in Class B. Would it work? I could not implement it properly.</p>
  
  <pre><code>Class A {
   public:
   int* v;
   B b1;
   A(int* var) : v(var), b1(var) {};
  }
  </code></pre>
  
  <p>How to access the same version of 'v' from a C class?
   I can define B and C however I like in order to achieve the goal. But I cannot change A for that purpose.</p>