title: Opening Binary files in C++, changing the mode of an open file
body: <p>I've got a program that deals with both Ascii and binary PGM images. I open the file open mode using: </p>
  
  <pre><code>ifstream istr(argv[i]);
  </code></pre>
  
  <p>After reading in the header of the PGM file, that determines if I'm dealing with binary data or ASCII. Is there a way then to change the istr to the binary mode? </p>