title: How to access from 1 class to other class struct
body: <p>I'm a beginner and trying to learn coding. So please excuse if my question is stupid. I have these 2 classes and I want the class Store to have access a data from struct Stock in class Toys. I'm not sure how can I do this?</p>
  <pre><code>#include &lt;vector&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  
  class Toys {
  public:
      struct Stock
      {
          int x;
          Stock(int value)
              :x(value) {}
      };
  };
  
  class Store {
  public:
      Toys myToy(int count) {
          _count = count;
      }
      Toys* myStore;
      //What do I need to do to bind a struct Stock from class Toy here?
  private:
      int _count;
  };
  
  int main()
  {
      Store myStore;
      int x;
      std::vector&lt;Toys::Stock&gt; stocks;
      std::cout &lt;&lt; &quot;Enter the availability for Water Gun.\n&quot;;
      std::cin &gt;&gt; x;
      for (int i = 0; i &lt;= x; i++) {
          stocks.push_back(i);
          std::cout &lt;&lt; stocks[i].x &lt;&lt; std::endl;
      }
  //Later I want to pull vector stocks from class Store here.
      return 0;
  }
  </code></pre>