RE:Dynamic allocation of arrays (fwd)

From: Masaharu Goto (MXJ02154@niftyserve.or.jp)
Date: Tue Jun 23 1998 - 12:44:00 MEST


Sean,

Please don't use  'TH1F xCov[]' with new statement. It is illegal in C++.
You should use  'TH1F *xCov = new TH1F[nHisto];' instead. 

Masaharu Goto

>Int_t nHisto = 3;
>TH1F xCov[] = new TH1F[nHisto];
>
>Root exits with the following error message,
>
>root [7] .L foo.C
>root [8] main()  
>Run-time error, libC:
>        'delete[]' does not correspond to any 'new[]'
>
>any suggestions are appreciated



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:34 MET