CList::GetSize
更新 : 2007 年 11 月
リストの要素数を返します。
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