How to add more than two strings in ROOT?

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.

[code]// http://root.cern.ch/root/htmldoc/TString.html
TString fullpath;

fullpath = dirname;
fullpath += ‘/’;
fullpath += fileName[i];
std::cout << "Full path for a file is : " << fullpath << std::endl;

fp = fopen(fullpath.Data(), “r”);[/code] [code]// http://www.cplusplus.com/reference/string/
std::string fullpath;

fullpath = dirname;
fullpath += ‘/’;
fullpath += fileName[i];
std::cout << "Full path for a file is : " << fullpath << std::endl;

fp = fopen(fullpath.c_str(), “r”);[/code]