Delen via


CList::GetHeadPosition

Gets the position of the head element of this list.

POSITION GetHeadPosition( ) const;

Return Value

A POSITION value that can be used for iteration or object pointer retrieval; NULL if the list is empty.

Example

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

// Add an element to the front of the list.
myList.AddHead(CString(_T("ABC")));

// Verify the element at the head position 
// is the one added.
POSITION pos = myList.GetHeadPosition();
ASSERT(CString(_T("ABC")) == myList.GetAt(pos));      

Requirements

Header: afxtempl.h

See Also

Reference

CList Class

Hierarchy Chart

CList::GetTailPosition