title: Reverse Array in C++
body: <p>I have successfully reversed a 1-D array but when I cout the contents, it prints out the contents then bunch of other numbers.</p>
  
  <pre><code>4
  3
  2
  1
  -858993460
  -858993460
  4
  -858993460
  -1021245226
  12384668
  3697177
  1
  14484784
  14501672
  -1021245434
  0
  Press any key to continue . . .
  </code></pre>
  
  <p>I can't tell why it's printing out those extra numbers. Below is my source code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;array&gt;
  
  using namespace std;
  
  void flipRow(int array[], int row) {
      int temp;
      for (int i = 0; i &lt; sizeof(array)/2; i++) {
          //cout &lt;&lt; "Hi" &lt;&lt; endl;
          temp = array[i];
          array[i] = array[row-1];
          array[row-1] = temp;
          row--;
      }
  }
  
  int main() {
  
      const int ROW = 4;
  
      int array[ROW] = { 1, 2, 3, 4 };
      flipRow(array, ROW);
  
      for (int i = 0; i &lt; sizeof(array); i++) {
          cout &lt;&lt; array[i] &lt;&lt; endl;
      }
  
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>Are those addresses? Can someone tell why it's printing them out? Thank you.</p>