Hello,
I am trying to add strings to get a path for the respective data file. My code is as follows:
void getFile()
{
FILE *fp;
char *dirname = “C:/Temp”;
char endingTxt = “.txt”;
char fileName[100]; // fileName is “ABCD.txt”
…
… // Doing some operation
//At the end
dirname->append("); // Append “opening brakets
dirname->append(fileName[i]);
Printf(“Directive and file name is : %s” dirname);
dirname->append(”); //Append " closing brakets
Printf(“Full path for a file is :” dirname); //Here I expect a full path as [color=#FF0000]“C:/Temp/ABCD.txt”[/color]
fp = fopen(fileName[i], “r”); // To open a respective file for a read operation
}
I am getting an error. I don’t know what is the correct way?
Please guid me.
Thank you.