title: Read bits from char array
body: <p>I have a function that takes a buffer of size 2kB and loads certain content to it.
  I can assume the function works properly, but i can't test it.</p>
  
  <p>The function prototype is</p>
  
  <pre><code>int loadContent(unsigned long, char* buffer);
  </code></pre>
  
  <p>Unsigned long is the number of a block i want to load (the size is fixed to 2kB for every block), and the buffer is where the content is loaded.</p>
  
  <p>Now i have to iterate bit by bit through the buffer and find the first bit that equals 1.</p>
  
  <p>To make sure buffer is sized 2kB i made a variable </p>
  
  <pre><code>char buffer[2048];
  </code></pre>
  
  <p>But how do i iterate bit-by-bit through array of chars?</p>
  
  <p>Would something like this be okay?</p>
  
  <pre><code>unsigned long getFreeCluster(){
      char helpbuffer[2048];
      partition-&gt;readCluster(0, helpbuffer);
      unsigned long comparator = 1;
      unsigned long position = 0;
  
      for(int i = 0; i&lt;16384; i++){
          if((cluster &amp; comparator) == 1){ position = i; break; }
      }
  
      return position;
  }
  </code></pre>
  
  <p>Basically, i'm just troubling if the if condition is valid? Can i do the op '&amp;' like that?</p>