c++ memcpy error
<p>I would like to copy 2 ints, 2 shorts and 1 char one after the other.</p>

<p>This is what I did:</p>

<pre><code>int32_t a=1;
int32_t b=2;
int16_t c=3;
int16_t d=4;
int8_t e=5;
char*buf=new char[104];
memcpy(buf, &amp;a, 32);
memcpy(buf + 32, &amp;b, 32);
memcpy(buf + 64, &amp;c, 16);
memcpy(buf + 80, &amp;d, 16);
memcpy(buf + 96, &amp;e, 8);
</code></pre>

<p>Is this correct ? My debugger says that the third line affects the second, but maybe I'm just misusing my debugger (more specifically, it says that the value of *((int32_t*)(buf+32)) changed between the second and third memcpy).</p>

<p>Thanks.</p>
