Re: Array of void pointers

Masaharu Goto (gotom@hpyiddq.jpn.hp.com)
Thu, 12 Jun 1997 9:48:49 JST


Victor,

At line 5, gROOT->Reset() deletes declared array of V[200]. So, when
you try to use it at line 27, automatic variable is implicitly allocated.
You need to place line 3 after gROOT->Reset().

Masaharu Goto

> 1.
> 2. {
> 3. void *V[200];
> 4.
> 5. gROOT->Reset();
.

> 27. V[1] = c1;
> 28. V[2] = c2;
> ...
>
> When I run it
>
> root [0] .x myh1.C
> Error: Array index out of range V[2]+2 valid upto V FILE:myh1.C LINE:28
> *** Interpreter error recovered ***
>
> It looks like that the real size of array V is less than declared 200.