title: Reading ppm file C++
body: <p>I am trying to read a ppm file and store its contents in an array. I am starting off by trying to display it but I can't seem to output anything. </p>
  
  <pre><code>char magic;
  ifstream myfile;
  myfile.open(file,ios::in | ios::binary);
    if (!myfile.is_open()) 
     {
        cout&lt;&lt;"Failed to open";
     }
  myfile.get(magic);
  if(myfile) cout &lt;&lt;magic &lt;&lt;"not working";
  myfile.close();
  </code></pre>
  
  <p>The file is opened but I can't read it. I have also tried outputting by using the &lt;&lt; operators, but no luck there either. </p>