Re: Problem with TObjArray::GetSize()

From: Hovhannes Khandanyan <khandan_at_cern.ch>
Date: Sun, 31 Oct 2010 16:51:00 +0100


  Hi Axel,

Thanks for the comment. I actually used 0 to initialize my TObjArray following the snippet found here:

http://root.cern.ch/download/doc/11InputOutput.pdf

Best,
Hovhannes

On Oct 31, 2010, at 7:54 AM, Axel Naumann wrote:

> Hi Hovhannes,
>
> for TObjArray, 0 storage is invalid. It overrules you by setting it to
> TCollection::kInitCapacity.
>
> Cheers, Axel.
>
>
> On 10/30/10 10:39 PM, Hovhannes Khandanyan wrote:
>>
>> Dear ROOTers,
>>
>> I ran into a problem with TObjArray::GetSize() which showed
>> unexpected
>> behavior, details on which are in the snippet below. Please let me
>> know
>> if this is in fact how it should be.
>>
>> root [0]
>> root [0] TObjArray* histArray = new TObjArray(0)
>> root [1] histArray->GetSize()
>> (const Int_t)16
>> root [2] TObjArray* histArray = new TObjArray(1)
>> root [3] histArray->GetSize()
>> (const Int_t)1
>> root [4] TObjArray* histArray = new TObjArray(0)
>> root [5] histArray->GetSize()
>> (const Int_t)16
>> root [6] .!echo $ROOTSYS
>> /afs/cern.ch/sw/lcg/app/releases/ROOT/5.26.00/slc4_amd64_gcc34/root
>> root [7]
>>
>> Thanks,
>> Hovhannes
>>
>>
>>
>
Received on Sun Oct 31 2010 - 16:51:36 CET

This archive was generated by hypermail 2.2.0 : Mon Nov 01 2010 - 11:50:01 CET