RE:new Class* [xxx]

Masaharu Goto (MXJ02154@nifty.ne.jp)
Tue, 18 Aug 1998 22:01:00 +0900


Stas,

> Dear Rooters.
> It looks like this simple allocator doesn't work in ROOT 2.00/09 (SunOS
>5.5.1):
>--------------------------
>root> TH1F **h;
>root> h = new TH1F* [10];
>root> h
>(class TH1F **)0x0
>-------------------------

This is a bug which happens for pointer to class object. I fixed this.

Workaround for current version is to new a void pointer instead.

root> TH1F **h;
root> h = new void*[10];
root> h

Of course, fixed version accepts 'new TH1F*[10]'.

Masaharu Goto