title: shift an array and insert a new element at given position using memcpy
body: <p>I need to shift the array and insert a new element at given position using <code>memcpy</code>. </p>
  
  <pre><code>Input: 2, 5, 7, 0, 0, 0
  
  Expected output: 2, 3, 5, 7, 0, 0
  
  Actual output: 2, 3, 5, 0, 0, 0
  </code></pre>
  
  <p>Is there a mistake in my <code>memcpy</code>? (I have to use arrays - not <code>std::vectors</code>)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
      int i=0;
      int len=0;
      int a[6] = {'\0'};
      a[0]= 2;
      a[1] = 5;
      a[2]= 7;
      len=3;
      int b=0;
      b = 2;
      memcpy(a+2, a+1, b * sizeof(int));
      //memcpy(a+2, a+1, sizeof(int) * (len-1));
      a[1]=3;
      for(i=0;i&lt;6;i++)
          printf("after %d \n", a[i]);
  }
  </code></pre>