Thank you, that does work! I do not think I will ever understand strings:(
By the way, can something similar can be done with TString. I mean can one convert TString to const char*? In other words, how do you use operator const char* (). Just doing
TString histoArray[2]= {
"L2_Cosmic_Muon_DeltaPt_vs_eta_DT_top",
"L2_Cosmic_Muon_DeltaPt_vs_eta_DT_bottom"
};
char histoname[100];
for(int i=0;i<2;i++) {
const char* histoArray[i](histoname);
}