I'm not sure if this is possible. Basically, I have a function that will detect the current active user.
string currentUser()
{
string user;
ofstream outf("CurrentUser.dat", ios::trunc);
system("whoami >> CurrentUser.dat");
outf.close();
ifstream inf("CurrentUser.dat");
inf >> user;
return user;
}
I have another function which will create a directory in the user's computer. The path will be:
/Users/*ActiveUser*/Library/Application Support.
Now, I have a data file containing only the name of the current active user. How can I insert that into a system command such as:
system("mkdir \"/Users/ActiveUserGoesHere/Library/Application Support\"");
If I read the contents of the data file into a string or other variable, can I insert them into that system command so it uses the string as part of the path?