title: Accessing vectors of structs
body: <p>I have a struct:</p>
  
  <pre><code>struct OutputStore 
  {
      int myINT;
      string mySTRING;
  }
  </code></pre>
  
  <p>If I create an array of type OutputStore as follows:</p>
  
  <pre><code>OutputStore *OutputFileData = new OutputStore[100];
  </code></pre>
  
  <p>then I can address it with:</p>
  
  <pre><code>OutputFileData[5].myINT = 27;
  </code></pre>
  
  <p>But if I use a vector instead of an array:</p>
  
  <pre><code>vector&lt;OutputStore&gt; *OutputFileData = new vector&lt;OutputStore&gt;(100);
  </code></pre>
  
  <p>Then I get an '... is not a member of 'std::vector&lt;_Ty>' error if I try:</p>
  
  <pre><code>OutputFileData[5].myINT = 27;
  </code></pre>
  
  <p>Since you can access a vector via it's index just as you can an array, why does this line not work.
  I'm just interested to know as it suggests I'm missing some fundamental bit of understanding.</p>
  
  <p>(I changed to a vector as I wanted to push_back as I do not know the size that my data will reach. I've got it to work by using a constructor for the structure and pushing back via that...I just want to understand what is going on here)</p>