title: c++ : unsequenced modification and access to "i"
body: <p>My ideas were quite simple.
  I wish to copy element by element from vector temp to vector data.</p>
  
  <pre><code>void copy(vector&lt;int&gt; &amp;data, vector&lt;int&gt; &amp;temp)
  {    
      int i=0;
      while (i&lt;data.size()) {
      data[i]=temp[i++];//unsequenced modification and access to "i"
      cout&lt;&lt;i&lt;&lt;endl;
  }
  </code></pre>
  
  <p>Outputs:
  temp={1,2,3,4}
  but data={1,1,2,3}
  even if i's cout values are 1,2,3,4</p>
  
  <p>wonder why.
  Thanks for help in advance!</p>