how could I creat a file at desired folder?
Below is my code and what I want to do is
1)I open the "newfile1.txt"and read the first line(e.g Cat) from this file
2) and then create the Cat.txt at "C:\user\user\Desktop\history"
Currently, I could creat Cat.txt at the folder where my program run but I want to creat file @ "C:\user\user\Desktop\history" instead.
{
ifstream readfile("newfile1.txt);
string str;
getline(readfile,str);
str=str+".txt";
ofstream outfile(str.c_str());
readfile.seekg(iso_base::beg);
outfile<<readfile.rdbuf();
readfile.close();
outfile.close();
}