title: C++ parameters of an input stream
body: <p>I was just wondering, is there anyway that you can have your user input the location of a file when trying to using a stream?</p>
  
  <p>Ex of what I want to do:</p>
  
  <pre><code>int main()
  {
  ifstream instream; 
  
  string file_location;
  cout &lt;&lt; "Enter in file location: " &lt;&lt; endl; 
  cin &gt;&gt; file_location;
  instream.open(file_location);
  }
  </code></pre>
  
  <p>So I want them to input the file location but the program won't compile.</p>
  
  <p>The error message I'm getting is:</p>
  
  <blockquote>
    <p>no matching function for call to 'std::basic_ifstream >::open(std::string&amp;)'</p>
  </blockquote>