CObArray::GetSize
Dizinin boyutunu döndürür.
INT_PTR GetSize( ) const;
Notlar
Sıfır tabanlı dizin olduğundan, 1'den büyük dizin büyük boyutudur.
Diğer üye benzer işlevleri aşağıdaki tabloda gösterilmektedir CObArray::GetSize.
Sınıf |
Üye işlevi |
---|---|
INT_PTR GetSize () const; |
|
INT_PTR GetSize () const; |
|
INT_PTR GetSize () const; |
|
INT_PTR GetSize () const; |
|
INT_PTR GetSize () const; |
|
INT_PTR GetSize () const; |
Örnek
Bkz: CObList::CObList bir listesi için CAge tüm koleksiyon örneklerde kullanılan sınıf.
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
Gereksinimler
Başlık: afxcoll.h