title: How to read a specific amount of characters from a text file
body: <p>I tried to do it like this    </p>
  
  <pre><code> #include &lt;iostream&gt;
   #include &lt;fstream&gt;
  
  using namespace std;
  
  int main()
  {
      char b[2];
      ifstream f("prad.txt");
      f&gt;&gt;b ;
      cout &lt;&lt;b;
      return 0;
  }
  </code></pre>
  
  <p>It should read 2 characters but it reads whole line. This worked on another language but doesn't work in C++ for some reason.</p>