Can't find the error in filling the tree

Hi Rooters,

In this program
example.C (445 Bytes)
I’m making some tries in order to store an array of Float_t in a TTree and then save the tree in a TFile; this array must have variable size, as in the real situation i don’t know how big is the array a priori.

So I uniformly fill an array and then store ii via the command

tree->Fill()

Doing this way, the interpeter gives me a Segmentation Violation message.
I looked at the macro located at $ROOTSYS/tutorials/tree/tree3.C and i think I followed it properly.

I hope to have explained myself

Thanks in advance

Krusty

prova.C (464 Bytes)

Hi, thanks for the reply

I made a little change in your file (just added ‘const’ before Int_t) and now seems to work properly

Thank you very much for your help

Krusty

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.