title: Don't understand how sscanf() function works
body: <p>I don't understand how to use <code>sscanf()</code> in C++ for reading from a file.</p>
  
  <p>I'm working on a program that reads three names of runners from a file, along with each of their five best times. I want to average out each runner's times and say who the best runner is. I am having the absolute hardest time with file IO.</p>
  
  <p>Cplusplus.com has helped some, but doesn't really say how to read off, separate the char* (names) from the floats (times), etc. Elsewhere, I can't escape jargon and explanations that are too technical.</p>
  
  <p>A friend showed me this code snippet to explain.</p>
  
  <pre><code>while(file&gt;&gt;str) {
      sscanf (str.c_str(),"%d",&amp;myint);
  }    
  </code></pre>
  
  <p>Anyone mind explaining to me how it's read?</p>