title: How to have c++ pause to wait for user input in for loop
body: <p>I have the following code snippet in c++</p>
  <pre><code>int main(){
    std::vector&lt;int&gt; numbers(10);
    for (int i = 0; i &lt; numbers.size(); i++){
      std::cout &lt;&lt; &quot;Please enter number &quot; &lt;&lt; i &lt;&lt; &quot;\n&quot;;
      std::cin &gt;&gt; numbers[i];
    }
  }
  </code></pre>
  <p>My hope is that for every value of i in the for loop, then code would wait for my input to enter the next number. However, instead I just get &quot;Please enter number i&quot; printed out 10 times, and the loop ends. I'm fairly new to c++ so I'm not too sure how to work around this, and moreover why my code is wrong.</p>