Re: [ROOT] pointer to fundamental type error

From: Kurt Rinnert (rinnert@ekp.physik.uni-karlsruhe.de)
Date: Mon Nov 26 2001 - 16:08:47 MET


Hi Joe,

the //[fftwPlanSize] basically tells rootcint how to generate a streamer
for your class. The generated code will stream fftwPlanSize floats
assuming a float array of size fftwPlanSize at the address fftwPlan.

So you have to keep fftwPlanSize in sync with the size of the array, e.g.
like this:

...
fftwPlanSize = 10;
fftwPlan = new float[fftwPlanSize];
...

cheers,
	Kurt

P.S.: We can hear you, no need to shout.

> Now to my main question, I saw that you have to add
> something like this below, but what if i dont KNOW the
> size yet ??Can I just specify some MAX size and root
> will take care if the array is later smaller ??
> 
> class MGraph {
>    ....
>    int    fftwPlanSize;
>    float *fftwPlan;   //[fftwPlanSize]  pointer to an
> array of suze
> fftwPlanSize
>    ....
> };

-- 
Kurt Rinnert, University of Karlsruhe (TH) - Faculty for Physics



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:09 MET