I wrote the C function in a separate file (func.C)
for simplicity it is now:
Double_t func(Double_t *arg,Double_t *par)
{
return arg[0]*par[0];
}
And now:
gROOT->LoadMacro("func.C");
TF1 f1("f1",func,-1,1,1);
f1.SetParameter(0,1);
f1.Draw(); // ok, it works
TF1 f2("f2",func,-1,1,1);
f2.SetParameter(0,2);
f2.Draw("same");
*** Break *** segmentation violation
What did I do wrong?
--------------------------------
something else:
If I want to write multiple statements between { }s, only the first line
seems to be executed:
int a=0;
int b=0;
for(int i=0; i<10; i++) {a++;
b++; }
now a=10, but b=1 !
but if I try
int a=0;
int b=0;
for(int i=0; i<10; i++) {a++; b++; }
now a=10,b=10.
Thanks
Daniel