Condividi tramite


CObArray::GetSize

Restituisce le dimensioni della matrice.

INT_PTR GetSize( ) const;

Note

Poiché gli indici sono a base zero, la dimensione è maggiore di 1 più grande indice.

Nella tabella seguente vengono illustrate altre funzioni membro che sono simili a CObArray::GetSize.

Classe

Funzione membro

CByteArray

Const di INT_PTR GetSize( );

CDWordArray

Const di INT_PTR GetSize( );

CPtrArray

Const di INT_PTR GetSize( );

CStringArray

Const di INT_PTR GetSize( );

CUIntArray

Const di INT_PTR GetSize( );

CWordArray

Const di INT_PTR GetSize( );

Esempio

Vedere CObList::CObList per un elenco CAge utilizzata in tutti gli esempi di raccolta.

CObArray myArray;

// Add elements to the array.
for (int i = 0; i < 10; i++)
   myArray.Add(new CAge(i));

// Add 100 to all the elements of the array.
for (int i = 0; i < myArray.GetSize(); i++)
{
   CAge*& pAge = (CAge*&) myArray.ElementAt(i);
   delete pAge;
   pAge = new CAge(100+i);
}

#ifdef _DEBUG
   afxDump.SetDepth(1);
   afxDump << _T("myArray: ") << &myArray << _T("\n");
#endif      

Requisiti

Header: afxcoll.h

Vedere anche

Riferimenti

Classe di CObArray

Grafico della gerarchia

CObArray::GetUpperBound

CObArray::SetSize

CObArray::GetCount