I am trying to add strings to get a path for the respective data file. My code is as follows:
char *dirname = “C:/Temp”;
char endingTxt = “.txt”;
char fileName; // fileName is “ABCD.txt”
… // Doing some operation
//At the end
dirname->append("); // Append “opening brakets
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.