title: Taking in array of unknown size in c++
body: <p>Ok I am extremely new to programming, and I am taking a c++ class. Basically for the current project I have to take in an array of unknown size, resize it, and output a bunch of statistics like average, Q1, Q3, etc. I am having trouble taking in the array from the user. I need to quit taking in variables once they enter 0. Here is what I have:</p>
  
  <pre><code>int i = 1; //When I first posted this I didn't mean to comment out the '= 1' part
  do {
      cin &gt;&gt; array[i];
      if (array[i] != 0)
          return true;
  } while (true);
  </code></pre>
  
  <p>What am I doing wrong? the program stops after I enter 1 number every time no matter what number I enter.</p>
  
  <p>I am using vector class btw.</p>