Original Post
Alright, here is my problem, for some stupid reason I can't get this to return the current item that my 'finder' is pointing to when it finds the name in the linked list. ( I cut out other parts of it to try and limit to smaller problem, and it problems here) Code:
typedef char str[25]
typedef struct NPC {
str NAME;
str LOCATION;
NPC *next;
} NPC;
NPC *FindPos (EntryType *nps, str name)
{
NPC *cur = nps;
while ( cur )
{
if ( cur->NAME == name )
{
return cur;
}
cur = cur->next;
}
return NULL;
}
Now, I tried:
NPC *toFind = FindPos( g_NPCS, "Kain" );
if ( !toFind )
{
cout << "Not Found!";
}else
cout << "FOUND!" << endl;
cout << toFind->LOCATION << endl;
}
Now I made sure it was added into the list, I'd display the list, it showed it was in the list, yet it never actually see's it if I look for it to display.. Anyone see a problem?