title: How to access variables in different class from other class
body: <p>x cannot be static</p>
  
  <p>I'd like to have</p>
  
  <pre><code>class A{
    static std::vector&lt;C&gt; vec_ca;
  public:
    int x = 6;
  `};
  class B{
   std::vector&lt;C&gt; vec_cb;
  public:
   int x = 7;
  };
  class C
  {
    void foo(){
    int  k = x;
    }
  };
  </code></pre>
  
  <p>And k will be set depending of it class: if k in vec_ca k = 6; if k in vec_cb k = 7. Is it possible to be done?</p>