title: Read file by bits c++
body: <p>i have binary file as input and i need to read it simple by bits. If i wanted to read file by characters i would use this:</p>
  
  <pre><code>    ifstream f(inFile, ios::binary | ios::in);
      char c;
      while (f.get(c)) {
          cout &lt;&lt; c;
      }
  </code></pre>
  
  <p>Output of this code is sequence of characters, what i need is sequence of 1 and 0. Function get() return next character and i could not find any ifstream function that would return next bit.</p>
  
  <p>Is there any similar way how to achieve it ?</p>
  
  <p>Thank anyone for help.</p>