extracting a bit from a buffer
<p>Whats the best way to extract a bit from an unsigned char .In my opinion ,I think this works perfectly well`</p>

<pre><code>int bit;
  unsigned char buffer;
  bit= 1 &amp; (buffer&gt;&gt;3) //`if i want to extract the fourth bit
  bit=  1 &amp; (buffer&gt;&gt;7)//if i want to extract the 8 bit
</code></pre>
