title: Find a string in a file C++
body: <p>I am trying to parse a file in C++. My file contents are as follows:</p>
  
  <pre><code>//Comments should be ignored
  
  FileVersion,1;
  Count,5;
  C:\Test\Files\Test_1.txt 0,16777216,16777552,0,0,1,0,1,1,1;
  </code></pre>
  
  <p>FileVersion is the first line I need to read information. All the previous lines are just comments which begin with a '//'. How do I set my cursor to line containing FileVersion? Becuase I am using fscanf to read the information from the file.</p>
  
  <pre><code>if  (  1 != fscanf( f, "FileVersion,%d;\n", &amp;lFileVersion ))
  {
       //Successfully read the file version.
  }
  </code></pre>