title: finding a line number that matches the text using C++
body: <p>I want to <em>open file</em> , <em>search for string</em> , <em>replace the string</em> and then in the end print from that <em>replaced string</em> until the end.</p>
  
  <p>So far I have opened the file using</p>
  
  <pre><code>fstream file ("demo.cpp");
  </code></pre>
  
  <p>Used </p>
  
  <pre><code>while (getline (file,line))
  </code></pre>
  
  <p>but using</p>
  
  <pre><code>string.find("something")
  </code></pre>
  
  <p>always give me line number 0, no matter which string I put in the arguments for <em>find()</em></p>
  
  <p>My question is, is there any other built in function which I can use in this situation or do I have to search through all lines, manually ?</p>