[code]TFile *infile = ((TFile *)0);
for (Int_t i = 0; i < 71; i++) {
if (!(FileName && FileName[i] && (*(FileName[i])))) continue; // just a precaution
if (infile) delete infile; // just a precaution
// http://root.cern.ch/root/html/TFile.html#TFile:Open
infile = TFile::Open(FileName[i]);
if (!infile) continue; // requested ROOT file does not exist or is unreadable
cout << "LAST FILE = " << gROOT->GetListOfFiles()->Last()->GetName() << endl;
cout << "FIRST FILE = " << gROOT->GetListOfFiles()->At(0)->GetName() << endl;
cout << "Filename = " << FileName[i] << endl;
// … here I take data from histograms stored in the files …
delete infile;
infile = ((TFile *)0);
}[/code]