title: Array shifting to the next element
body: <p>How can I move elements in an array to the next element</p>
  
  <pre><code>eg: x[5] = { 5, 4, 3, 2, 1 }; // initial values
      x[0] = 6; // new values to be shifted
      x[5] = { 6, 5, 4, 3, 2 }; // shifted array, it need to be shifted, 
                                // not just increment the values.
  </code></pre>
  
  <p>This what I've done so far. It's wrong, that's why I need help here. Thanks in advance.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main() 
  {
    int x[5] = { 5, 4, 3, 2, 1 };
  
    int array_size = sizeof(x) / sizeof(x[0]);
  
    x[0] = 6;
  
    int m = 1;
  
    for(int j = 0; j &lt; array_size; j++) {
      x[m+j] = x[j];
      cout &lt;&lt; x[j] &lt;&lt; endl;
    }
  
    return 0;
  }
  </code></pre>