Trying to create 20 files using ofstream. I could name each individual file on creation, file01.txt, file02.txt ect but wondered if it was possible to use a string variable in place of say the file name (file01.txt) and then use a loop to create the other files. Does the name have to be a declared name or is the use of a variable possible?
ofstream outfile( "file01.txt", ios::app);
Can a variable be put in it's place (and if so how do you code it?) please. If not is there any other way around this?