title: c++ : parse file to find precise line
body: <p>I'm a beginner I c++ so I don't really know if a function like I search already exists. I want a function that parse a file to find a line that begin by a precise string, and return it.</p>
  
  <p>For example, If I have a file like that :</p>
  
  <pre><code>test  4645
  foo   erf   rfr 564
  bar   I like train
  sponge bob
  </code></pre>
  
  <p>I would like to do something like </p>
  
  <pre><code>std::string line = Func("/my/path/file", "bar");
  std::cout &lt;&lt; line &lt;&lt; std::endl; // display bar    I like train 
  </code></pre>