title: Testing the endianness of a machine
body: <p>Here is the program I used:</p>
  
  <pre><code>int hex = 0x23456789;
  char * val = &amp;hex;
  printf("%p\n",hex);
  printf("%p %p %p %p\n",*val,*(val+1),*(val+2),*(val+3));
  </code></pre>
  
  <p>Here is my output:</p>
  
  <pre><code>0x23456789
  0xffffff89 0x67 0x45 0x23
  </code></pre>
  
  <p>I am working on a 64 bit CPU with a 64 bit OS. This shows my machine is little endian. Why is the first byte 0xffffff89? Why the ff's?</p>