To search a linked list you have to traverse the list. Here is a snippet of code that will traverse a list. It assumes the list pointer aims at the head of the list and there is a method to get a pointer to the next entry in the list.
ListItem * p = pList;
while( p )
{
p = p->Next();
}
Typically each entry of the list has a pointer to the next entry (the link) so the Next method would just return that or you could change it to assign the pointer to p. If your comparison finds a match then you have a pointer to the list item to use. A common thing to do is to make a search function to find a text string in the list. Here's an example of one where the ListItem has a pointer to a text string and the pointer to the next item is called pNext :
ListItem * FindText( ListItem *pList, const char *txt )
{
ListItem * p = pList;
while( p )
{
if( strcmp( p->Text, txt ) == 0 )
break; p = p->pNext;
}
return p; }