The reason your other code wasn't working was that you had:
createFile::createFile(const char* name)
{
char* path = "C:\\Programs\\PROGRAMS\\";
path = strcat(path, name);
path = strcat(path, (const char*)'\\');
path = strcat(path, name);
path = strcat(path, (const char*)'.txt');
}
when you should've probably had something like this:
createFile::createFile(const char*name)
{
char path[] = "C:\\Programs\\PROGRAMS\\";
strcat(path, name);
strcat(path, (const char*)"\\");
strcat(path, name);
strcat(path, (const char*)".txt");
}