다음을 통해 공유


CList::GetSize

목록 요소 수를 반환합니다.

INT_PTR GetSize( ) const;

반환 값

목록의 항목 수입니다.

설명

목록에 있는 요소의 개수를 검색 하려면이 메서드를 호출 합니다.이 메서드를 호출 하는 것과 같은 결과 생성 된 CList::GetCount 메서드.

예제

// Define myList.
CList<CString,CString&> myList;

// Add two elements to the list.
myList.AddHead(CString(_T("ABC")));
myList.AddHead(CString(_T("123")));

// Remove the head element and verify the list.
// NOTE: once the head is removed, the number of
// elements in the list will be one.
CString strHead = myList.RemoveHead();
ASSERT((CString(_T("123")) == strHead) && (myList.GetSize() == 1) && 
   (CString(_T("ABC")) == myList.GetHead()));      

요구 사항

헤더: afxtempl.h

참고 항목

참조

CList 클래스

계층 구조 차트

CList::GetCount