Re: Problem with TObjArray::GetSize()

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Sun, 31 Oct 2010 07:54:50 +0100


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 - 07:54:59 CET

This archive was generated by hypermail 2.2.0 : Sun Oct 31 2010 - 17:50:01 CET