title: Why does memcpy() handle integer destination as Big Endian but does not for char destination?
body: <p>The computer I am running the following code is Little Endian.</p>
  <pre><code>uint32_t src_uint = 0xAABBCCDD;
  uint32_t dest_uint = 0;
  uint8_t dest_arr[4] = {0};
  
  memcpy(&amp;dest_uint, &amp;src_uint, 4);
  printf(&quot;\ndest_uint: 0x%X\n&quot;, dest_uint);
  // output: 0xAABBCCDD
  
  memcpy(dest_arr, &amp;src_uint, 4);
  printf(&quot;\ndest_arr : 0x&quot;);
  for (int i = 0; i &lt; 4; i++)
      printf(&quot;%X&quot;, dest_arr[i]);
  // output: 0xDDCCBBAA
  </code></pre>
  <p>For me, the second output (0xDDCCBBAA) is correct because my computer is little endian. However, the first output (0xAABBCCDD) should be instead 0xDDCCBBAA since Little Endian would store variable <code>src_uint</code> in memory as: 0xDDCCBBAA. It seems that either memcpy() is not being transparent regarding its arguments or C compiler handles int differently in those situations...</p>
  <p>Thank you!</p>