How do you compare and sort chararrays in a linked list, cant you compare like this 'Smith' > 'Andersson' ?
struct person {
char name[20];
struct person *nextPerson;
};
.
void createNode(PersonPtr *sPtr, struct person t[]){
PersonPtr newPtr; /* pointer to new node */
PersonPtr previousPtr; /* pointer to previus node in list */
PersonPtr currentPtr; /* pointer to current node in list */
.
/* loop to find correct location in the list */
while (currentPtr != NULL && t->name > currentPtr->name) { /* this will not sort on name */
previousPtr = currentPtr; /* walk to... */
currentPtr = currentPtr->nextPerson; /* ...next node */
}/* end while */