title: Accessing array inside vector in c++
body: <p>I have this piece of code.</p>
  
  <pre><code>std::vector&lt;int&gt; aVector;
  int anArray[2];
  unsigned anArraySize = sizeof(anArray) / sizeof(int);
  for (unsigned int j = 0; j &lt; 100; j += 10) {
      for (unsigned int i = 0; i &lt; 100; i += 3) {
          anArray[0] = j;
          anArray[1] = i;
          aVector.insert(aVector.end(), &amp;anArray[0], &amp;anArray[anArraySize]);
      }
  }
  </code></pre>
  
  <p>It is basically inserting an array of size two(0, 1) into the vector called ijVector.</p>
  
  <p>Now, I would like to access the anArray values in anArray[0] and anArray[1] for each value in aVector.</p>
  
  <p>For example, something like</p>
  
  <pre><code>for (int i = 0; i --&gt; aVector.size() - 1;) {
      std::cout &lt;&lt; "aVector[" &lt;&lt; i &lt;&lt; "].anArray[0] = " &lt;&lt; aVector.anArray[0] &lt;&lt; std::endl; // getting value is wrong
      std::cout &lt;&lt; "aVector[" &lt;&lt; i &lt;&lt; "].anArray[1] = " &lt;&lt; aVector.anArray[1] &lt;&lt; std::endl; // getting value is wrong
  }
  </code></pre>
  
  <p>How do I get the value inside array of each vector?</p>