Hey! I've recently come back to C++ to tackle another project, but I've run into a problem I can't figure out.
#include <iostream>
#include <string>
#include <fstream>
#include <direct.h>
using namespace std;
int main()
{
string variable = "AwesomeName";
mkdir ("test");
ofstream write ("test\\" (variable+".txt").c_str() ); // this the place where I'm having trouble
write.close();
return 0;
}
I don't know if this is possible or not, but I want to know if there is a way to create a text file inside a directory using a variable as a name. Any help would be appreciated!
-AP