I have to save a set of histogram arrays, but I cannot figure the exact code. The histogram array has already been defined without a problem. What I need to do is to save each histogram in the array to a seperate file. Here is the code, which I tried:
const char *file_name[20];
Int_t newfile;
for (int i=0; i<5; i++) {
c1->cd(); //c1 refers to my canvas
nb_cap_a_z[i]->Draw(); //This is the histogram array. 5 are in array.
newfile = sprintf (file_name, “file_aa_%u.C”,i);
c1->Print(file_name);
}
Is there a way to fix this set of code so that the c1->Print gives me automatically five .C files with the appropriate histogram from the array in there.
cpoole