Hi everyone.
Im new in C++, actually im doing my first project, and i have a few questions, if you guys could help me it would be awesome. :)
In a method i have to create a .txt file, It have a parameter indicating the number of the file. But the parameter is an int variable and i need to change it to char* and then concatenate it to more char* variables.
void Labyrinth::createFile(int numberFile){
char* numFile = (char*)numberFile;
char* namePt1 = "Labyrinth";
char* namePt2 = ".txt";
const char* finalName = HERE I NEED TO CONCATENATE namePt1+numFile+namePt2
ofstream fileLabyrinth;
fileLabyrinth.open(finalName);
}
I know the file.open() needs a const char* var.
So, I dont know how to change the int var to char*, and then concatenating it to two or more char*.
Thanks.