title: Bitwise operator to get byte from 32 bits
body: <p>I am interested in writing a function <code>getMyByteChunkFunction</code> that accepts two parameters - a 32-bit integer and a byte offset (0, 1, 2, or 3), then returns the corresponding byte out of the 32-bit integer.  For example, given this integer:</p>
  
  <pre><code>            (3)         (2)      (1)      (0)   ---byte numbers
  int word = 10101010 00001001 11001010 00000101
  </code></pre>
  
  <p>the function call <code>getMeByteChunkFunction(word, 2)</code> returns <code>00001001</code>.</p>
  
  <p>However, I am limited in the bitwise operators I can use.  I am only allowed to use <code>&gt;&gt;</code>, <code>&lt;&lt;</code>, and <em>exactly one</em> subtraction.  I know how to do this using AND and XOR, but I don't know how I'd use a subtraction here.  Any ideas?</p>