Hi Phil,
The TF1 constructor has 3 signatures.
You are calling the wrong constructor in case of an interpreted
function.
You must specify the number of parameters of your function. In your
case,
you have 0 parameters. I made the change in your code below.
Rene Brun
Phil Adamson wrote:
>
> Double_t myfunc(Double_t *x, Double_t *par)
> {
> return (Double_t) *x;
> }
>
> void test(void) {
>
> TCanvas *c = new TCanvas("c","Test",100,100,600,600);
>// TF1 *f1 = new TF1("f1",myfunc,0,5);
TF1 *f1 = new TF1("f1",myfunc,0,5,0);
> c->SetGridx();
> c->SetGridy();
> f1->Draw();
> }
>
> Root 2.22/10
>
> root [2] .L test.C
> root [3] test()
>
> *ERROR 26 :
> Unknown name : "myfunc"
>
> Am I doing something silly?
>
> Phil
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:42 MET