title: Simple C++ input from file...how to?
body: <p>I have a file:</p>
  
  <pre><code>P 0.5 0.6 0.3
  30 300
  80 150
  160 400
  200 150
  250 300
  T
  r  45 0 0
  s 0.5 1.5 0 0
  t 200 –150
  .
  .
  .
  </code></pre>
  
  <p>When I read in 'P' I know that 3 floats will follow. That will be followed by a finite number of X and Y coordinates. The number will vary until a 'T' is reached which I have to recognize. Then there could be an 'r', 's' or 't' followed by some values.</p>
  
  <p>Anyways I know how to recognize 'P' and then take in the 2 floats but then I know I have to have a while loop for the X and Y coordinates which will stop when I get to a 'T'. I do not know enough about C++  to make the loop stop and recognize the 'T' and then do something else.</p>
  
  <p>An example to explain would be appreciated. Thanks in advance!</p>