Answer the question
In order to leave comments, you need to log in
How to copy a file to a new C++ folder?
1. The program creates a folder with the name specified by the user
2. We have a Data resource folder in the folder with the program executable
3. You need to copy the file from the Data folder to the newly created user
The problem is clear to me and seems to have already found a solution, but it gives error while copying, does not accept the name string data type in the copyfile command. (Save is SaveDialog1, just stung the name so as not to write a long one).
String name = Edit1->Text;
Save->FileName = name;
name+="\\title.ly";
if (Save->Execute()) {
CreateDir(Save->FileName);
CopyFile("data\\title.ly", name, true);
}
Answer the question
In order to leave comments, you need to log in
and f-I CopyFile what type does it require from you?
maybe she needs wchar_t?
something like
(const wchar_t*)name.utf16()
Casting String to char* will save you. Perhaps something like name.c_str() is needed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question