title: Bit operations in C
body: <p>So if I have an integer that is 32 bits. The first 28 bits (from left) are to store the size of a memory chunk, the next two are 0s and the last two are:</p>
  
  <ul>
  <li>to store the if it is the last node and then</li>
  <li>to store if it is used or not (respectively).</li>
  </ul>
  
  <p>What I am trying to do is to know how to turn the flag on and off on the isLast operation and the isUsed operation.</p>
  
  <p>(If we consider only the last two integers (again, we start left) then 01 would be not last and is used for example, one more example is 11 is last and is used, 00 is not last and not used.)</p>
  
  <p>I want to be able to turn the flags on and off in an easy way. I know I will need to use bit operations including &amp; and | but I am not sure how.</p>
  
  <p>Please ask me questions if you need more description of the problem.</p>