Re: help with C



Im trying create a link list by accepting initial input from a file
<that part of my program is working ok>
the link list must be maintained in increasing alphabetical order base
on the employee's last name
employees with the same last name I need to listed in alphabetical
order based on the first name and if the have the same last name and
first name need to listed in ascending order based on employee id

trying to do the last name for now and see how it works

EIS* inserting(EIS *fPtr,EIS *tempPtr)
{
EIS *prev = NULL;
EIS *curr = NULL;

if(fPtr == NULL)< this is checking if the list is empty>
return tempPtr;

curr = prev = fPtr;<this is setting the other pointers to the first
node>
tempPtr->nextnode = curr; <this one is for the second node>
while(curr != NULL)
{
if(strcmp(tempPtr->lastname,curr->lastname) > ZEROI)
{
if(curr == prev)
return tempPtr;
else
prev->nextnode = tempPtr;
return fPtr;
}
else
{
prev = curr;
curr = curr->nextnode;
}
}
prev->nextnode = tempPtr;
return fPtr;
}



I dont know why is not working

.



Relevant Pages

  • Re: help with C
    ... this loop only exits if tempPtr is NULL. ... > return fPtr; ... > prev = curr; ...
    (comp.lang.c)
  • Re: help with C
    ... EIS* inserting(EIS *fPtr,EIS *tempPtr) ... EIS *prev = NULL; ... EIS *curr = NULL; ... return fPtr; ...
    (comp.lang.c)
  • x# Filmkritik
    ... Sex! ... Eis! ... Hauke Reddmann <:-EX8 fc3a501@xxxxxxxxxxxxxx ... Prev by Date: ...
    (de.talk.jokes)
  • Re: We need a blacklist
    ... EIS ... David Dennis ... Anthony Fauci ... Prev by Date: ...
    (sci.med.diseases.lyme)