[求助]链表SearchList
查找函数:SearchList(LinkList *head, int item)
返回其位置!!
static int SearchElem(LinkList headPtr)
{
int c, position = 0;
puts("Enter search node data: ");
c = getchar();
for (;headPtr != NULL; headPtr = headPtr -> nextPtr)
{
position++;
if (headPtr -> data == c)
{
return position;
}
}
return 0;
}
创建函数就用原来的就行,没找到情况下返回0,找到情况下返回起位序