i'm having a problem using stricmp in a specific function, in other functions it works perfectly, except this one. the problem is that even if it compares the same string (char*) it doesn't return 0. what might be the problem? (sorry for the mess, i'll try formatting it) that's the code:
Employee* CityCouncil::FindEmp(list<Employee*> *lst, char* id)
{
bool continue1 = true;
Employee* tmp= NULL;
char* tmpId = NULL, *tmpId2 = NULL;
list<Employee*>::iterator iter = lst->begin();
if ((id == NULL) || (lst->empty()==true))
return NULL;
while ((iter != lst->end()) && (continue1)){
tmp = (Employee*)(*iter);
tmpId = (*tmp).GetId();
if(tmpId != NULL)
{
if(stricmp(tmpId,id) == 0)
continue1 = false;
}
if (continue1 == true)
iter++;
}
if (iter == lst->end())
return NULL;
return (Employee*)(*iter);
}