title: Memcpy change the pointers?
body: <p>My task is to exploit a program which has two lines of code of memcpy. So I'm now studying memcpy and just found this. </p>
  
  <pre><code>int main() {
      char a[10] = "123456789";
      cout&lt;&lt;a&lt;&lt;endl;
      char b[5];
      memcpy(b, a, 10);
      cout&lt;&lt;a&lt;&lt;endl;
      cout&lt;&lt;a-5&lt;&lt;endl;
      cout&lt;&lt;b&lt;&lt;endl;
  }
  </code></pre>
  
  <p>and the output will be:</p>
  
  <pre class="lang-none prettyprint-override"><code>123456789
  6789
  123456789
  123456789
  </code></pre>
  
  <p>Any idea Why the pointer of a changed here?</p>