title: Swap bytes within an unsigned long (8 bytes) in C
body: <pre><code>unsigned long swap_bytes(unsigned long n) {
      unsigned char bytes[8];
      unsigned long temp;
      bytes[0] = (n &gt;&gt; ??) &amp; 0xff;
      bytes[1] = (n &gt;&gt; ??) &amp; 0xff; 
      // ...
  }
  </code></pre>
  
  <p>I am really confused on how to shift an 8 byte <code>unsigned long</code> from
   ex: <code>0x12345678deadbeef</code> to <code>0x34127856addeefbe</code>. I started this but I am now stuck. Please help.</p>