How to open a file .txt that the user input in ifstream

How to open a file that the user input

1
2
3
4
ifstream InFile;
ofstream OutFile;

InFile.open("???.txt")
Ask the user for the filename, use std::getline to put it into a std::string, and then use that as the filename.
Can u write it more clearly in codes ?
Read about string and getline and then you can do it...
Topic archived. No new replies allowed.