title: Read PPM files RGB values C++
body: <p>I'm trying read from a PPM file.
  I want to read the first, second and third number from each row, in <a href="http://i.stack.imgur.com/MtiSh.png" rel="nofollow">this file</a>, but I don´t know how to read the lines. </p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>for (int y = 4; y &lt;= HEIGHT; y++) { // i think it has to start on row 4 
      for (int x = 1; x &lt;= WIDTH; x++) { // and x from 1
           int i = 4;
  
           int r = CurrentR(i);
           int g = CurrentG(i);
           int b = CurrentB(i);
           i++;
      }   
  }
  
  int CurrentR(int I) {
      return // the first number in row xy
  }
  int CurrentG(int I) {
      return // the second number in row xy
  }
  int CurrentB(int I) {
      return // the third number in row xy
  }
  </code></pre>