CObList::Find
Visual Studio 2008
Searches the list sequentially to find the first CObject pointer matching the specified CObject pointer.
POSITION Find( CObject* searchValue, POSITION startAfter = NULL ) const;
Note that the pointer values are compared, not the contents of the objects.
The following table shows other member functions that are similar to CObList::Find.
Class | Member Function |
|---|---|
POSITION Find( void* searchValue, POSITION startAfter = NULL ) const; | |
POSITION Find( LPCTSTR searchValue, POSITION startAfter = NULL ) const; |
See CObList::CObList for a listing of the CAge class.
CObList list; CAge* pa1; CAge* pa2; POSITION pos; list.AddHead(pa1 = new CAge(21)); list.AddHead(pa2 = new CAge(40)); // List now contains (40, 21). if ((pos = list.Find(pa1)) != NULL) // Hunt for pa1 { // starting at head by default. ASSERT(*(CAge*) list.GetAt(pos) == CAge(21)); }