title: Reading/Writing bits in memory
body: <p>Let's say I'm given a <code>void*</code> memory address and I need to print the bits located in this memory address. How can I do this?</p>
  
  <p>In my processor memory addresses are 32bits as are memory values, also int are 32 bits.
  So I thought of doing this:</p>
  
  <pre><code>unsigned int value = *memory_address;
  </code></pre>
  
  <p>and then by simple arithmetic (some <code>mod</code> and <code>div</code> operations) to get the bits of the value saved in <code>memory_address</code>. </p>
  
  <p>For example <code>value mod 2</code> will give last bit of this value and so on. But from what I can tell (I was expecting different bits) it doesn't work. Any ideas why? </p>
  
  <p>Also, is anyone aware of ready C source code that "does" such this, reads/writes bits from memory?</p>