If you need only "use these variable names for passing to other functions" why not to do it simpler, like: const char *Avars[] = { "Total", "Debrems", "Dedelta", "Deelse", "Deepair", "Demunu", "Demuon", "Costhmu", "Deelse", "Ener", "Gmtns", "Gmtsec", "Id", "Ievent", "Nch", "Nhits", "Nstr", "Ntr", "Phimu", "Toff","Trigg", "Vmu", "Zmu", 0 }; Victor "Kevin M. Rhodes" wrote: > > Any explanations why this won't work: > > { > gROOT->Reset(); > TObjString *Avars[23] = { "Total", "Debrems", "Dedelta", "Deelse", > "Deepair", "Demunu", "Demuon", "Costhmu", > "Deelse", "Ener", "Gmtns", "Gmtsec", "Id", > "Ievent", "Nch", "Nhits", "Nstr", "Ntr", > "Phimu", "Toff","Trigg", "Vmu", "Zmu" }; > > TString temp = Avars[0].GetString(); > cout << temp.Data() << endl; > } > > I just need to use these variable names for passing to other functions, > and all I've accomplished is getting their memory adresses to print. > Thanks in advance for any help. > > Kevin Rhodes > UW-Madison > Amanda Project -- Victor M. Perevoztchikov perev@bnl.gov perev@vxcern.cern.ch Brookhaven National Laboratory MS 510A PO Box 5000 Upton NY 11973-5000 tel office : 631-344-7894; fax 631-344-4206; home 631-345-2690
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:31 MET