title: Swapping values in array C++
body: <p>This is the code:</p>
  
  <pre><code>for (i = 0; i &lt; size; i++)
  {
      swap(a[i], a[size - i - 1]);
  }
  </code></pre>
  
  <p>It looks correct.. and it is because I have used it in other languages, but on C++ it doesn't work. Any suggestions? Thanks</p>