title: C++ How to initialize array in struct of unknown size
body: <p>So I have this structure definition in my header file, inside this structure is an array of another structure. I want to read in the size of this array from a file, but I just can't figure out how. </p>
  
  <pre><code>struct Struct1
  {
  struct Struct2 sArry[];
  };
  
  //And then initialize sArry[] as a size read from file
  inFile &gt;&gt; size;
  Struct1-&gt;sArry[size];
  </code></pre>