title: How to access variables in different class from other class?
body: <p>Let just say that we have two classes, <code>A</code> and <code>B</code>.<br>
  Here is code for both of them  </p>
  
  <pre><code>class A
  {
  public:
      int x;
  };
  
  class B
  {
  public:
      int y;
      void FindY() { y = x + 12; }
  };
  
  void something()
  {
      A fs;
      B fd;
      fs.x = 10;
      fd.FindY();
  }
  </code></pre>
  
  <p>the problem is that i want to access x but i don't wanna pass anything as argument to my function i look at friend and inheritance but both didn't seem to help me, correct me if i'm wrong.<br>
  some how i need to find x in function <code>FindY()</code>.<br>
  I'm going with the static method but in my case i get this error.  </p>
  
  <p>Error   2   error LNK2001: unresolved external symbol "public: static class <code>std::vector&lt;class GUIDialog *,class std::allocator&lt;class GUIDialog *&gt; &gt; Window::SubMenu" (?SubMenu@Window@@2V?$vector@PAVGUIDialog@@V?$allocator@PAVGUIDialog@@@std@@@std@@A)  C:\Users\Owner\documents\visual studio 2010\Projects\Monopoly\Monopoly\Window.obj</code>
  Here is how i declared it  </p>
  
  <pre><code>static vector&lt;GUIDialog *&gt; SubMenu;
  </code></pre>
  
  <p>I get that error because of this line  </p>
  
  <pre><code>SubMenu.resize(3);
  </code></pre>