- #1
burritoloco
- 83
- 0
Hello,
I'm wondering how to name/open a file whose name is given by a string with an integer appended at the end, i.e., something in the style of the following. Thank you!
int i = 5;
ofstream fout;
string s = "Hello " + i;
fout.open(s);
// write something to the file
fout.close();
I'm wondering how to name/open a file whose name is given by a string with an integer appended at the end, i.e., something in the style of the following. Thank you!
int i = 5;
ofstream fout;
string s = "Hello " + i;
fout.open(s);
// write something to the file
fout.close();