Ntuple filling

I wrote new program, but i can not fill ntuple correctly. i attach my C file for you. Please look at my file and say me what problem is.
caen.cpp (2 KB)

Hi,

You need to create the TNtuple after the TFile and/or associate it explicitly to the TFile: TFile *f=new TFile("tree1.root","RECREATE"); TNtuple *ntuple=new TNtuple("ntuple"," ","x:y");

Cheers,
Philippe.