save files with different names

i can't find any better place to get a clear answer to my q?
i have just make some programs in c++ but:

1- i want every user of the programe when he entered his values for calculation
to write any name he want and this name become the .txt file for his own.

2-how to make another file with .exe to display it with his previously entered values if he want to modify any input data for new claculation.
1. You can use strings:
1
2
3
4
std::string name;
std::getline ( std::cin, name );
name += ".txt";
std::ofstream file ( name.c_str() ); // open file called  (user name).txt 


2. Open the same file that you used to save data in
Topic archived. No new replies allowed.