Re: Array of void pointers

From: Masaharu Goto (gotom@hpyiddq.jpn.hp.com)
Date: Thu Jun 12 1997 - 02:48:49 MEST


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.



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