title: ifstream::open() function using a string as the parameter
body: <p>I'm trying to make a program that asks for the file that they user would like to read from, and when I try to <code>myfile.open(fileName)</code> I get the error: "no matching function for call to <code>std::basic_ifstream&lt;char, std::char_traits&lt;char&gt; &gt;::open(std::string&amp;)'</code>" at that line.</p>
  
  <pre><code>string filename;
  cout&lt;&lt;"Enter name of file: ";
  cin&gt;&gt;filename;
  ifstream myFile;
  myFile.open(filename); //where the error occurs.
  myFile.close();
  </code></pre>