Hi, I am using root v5.27/04 on SL5, and I am confused by the code below. I am trying to pass a fit option to the TH1:Fit function, but the first 2 function calls do not work properly (they are not fitting quietly) while the last 2 function calls can work (fitting quietly). Could anyone explain this to me? Thanks!
[code]
TH1F *h1 = new TH1F (“h1”,“h1”,100,-4,4);
h1->FillRandom(“gaus”);
Option_t Fit1 = (“Q”);
Option_t *Fit2 = &Fit1 ;
Option_t *Fit3 = &(“Q”);
Option_t Fit4 = *Fit3 ;
cout<<"1 passing by address "<<endl;
h1->Fit(“gaus”,&Fit1);
cout<<"2 passing by pointer "<<endl;
h1->Fit(“gaus”,Fit2);
cout<<"3 passing by pointer "<<endl;
h1->Fit(“gaus”,Fit3);
cout<<“4 passing by address”<<endl;
h1->Fit(“gaus”,&Fit4); [/code]