CObArray::GetSize

Retorna o tamanho da matriz.

INT_PTR GetSize( ) const;

Comentários

Como os índices são baseado em zero, o dimensionar é maior do que o maior índice 1.

A tabela a seguir mostra outras funções de membro semelhantes a CObArray::GetSize.

Classe

Função de membro

CByteArray

INT_PTR GetSize () const;

CDWordArray

INT_PTR GetSize () const;

CPtrArray

INT_PTR GetSize () const;

CStringArray

INT_PTR GetSize () const;

CUIntArray

INT_PTR GetSize () const;

CWordArray

INT_PTR GetSize () const;

Exemplo

See CObList::CObList para obter uma lista do CAge classe usada em todos os exemplos de coleção.

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      

Requisitos

Cabeçalho: afxcoll.h

Consulte também

Referência

Classe CObArray

Gráfico de hierarquia

CObArray::GetUpperBound

CObArray::SetSize

CObArray::GetCount

Outros recursos

CObArray membros