title: can not swap array elements c++
body: <p>I am new to C++. I am trying to solve a problem in the textbook: swap the first and last element in an array. But when I run the code I wrote, nothing happened and even the sentence "Please enter the numbers in the array: " does not show up. Anyone could give some help? Thanks.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int swap(int values[], int size)
  {
      int temp = values[0];
      values[0] = values[size-1];
      values[size-1] = temp;
  }
  
  int main()
  {
      const int SIZE = 5;
      int test[SIZE];
      cout &lt;&lt; "Please enter the numbers in the array: " &lt;&lt; endl;
      int input;
      cin &gt;&gt; input;
      for(int i=0; i&lt;SIZE; i++)
      {
              test[i] = input;
      }
      swap(test, SIZE);
      cout &lt;&lt; test[SIZE] &lt;&lt; endl;
      return 0;
  }
  </code></pre>