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?
Ex of what I want to do:
int main()
{
ifstream instream;
string file_location;
cout << "Enter in file location: " << endl;
cin >> file_location;
instream.open(file_location);
}
So I want them to input the file location but the program won't compile.
The error message I'm getting is:
no matching function for call to 'std::basic_ifstream >::open(std::string&)'