title: C++ ifstream error using string as opening file path.
body: <p>I have: </p>
  
  <pre><code>string filename: 
  ifstream file(filename);
  </code></pre>
  
  <p>The compilers complains about no match between ifstream file and a string. Do I need to convert filename to something?</p>
  
  <p>Here's the error:</p>
  
  <pre><code>error: no matching function for call to ‘std::basic_ifstream&lt;char, std::char_traits&lt;char&gt; &gt;::basic_ifstream(std::string&amp;)’
  /usr/include/c++/4.4/fstream:454: note: candidates are: std::basic_ifstream&lt;_CharT, _Traits&gt;::basic_ifstream(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;]
  </code></pre>