title: Microsoft C++ exception: std::out_of_range at memory location
body: <p>I was trying to output a specific line in the file using the find() and substr(), just to see if it works. As you can see i'm quite a beginner so i would appreciate any comments or tips on my code. </p>
  
  <pre><code>inFile.open("config.txt");
  string content;
  while (getline(inFile, content)){
  
      if (content[0] &amp;&amp; content[1] == '/') continue;
  
      size_t found = content.find("citylocation.txt");
      string city = content.substr(found);
  
      cout &lt;&lt; city &lt;&lt; '\n';
  
  }
  </code></pre>