The system lets the user to delete a customer by entering customer's IC Number. I am using queue with linked list.I have assigned front (headptr) to thisptr (current). The problem is at if-else statement [the comparison of thisptr->ic with ic_no]. It keeps execute else statement although the statement is true. May i know how to solve it and why is this happened? Really appreciated for helping.
void delete_node(){
system("cls");
char ic_no[20];
printf("Enter Customer IC: ");
scanf(" %s", &ic_no);
thisptr = front;
while(thisptr !=NULL){
if(thisptr->ic == ic_no){
printf("true\n");
break;
}
else{
printf("f\n");
thisptr = thisptr->nextptr;
}
}
if(thisptr == NULL){
printf("No Customer is found!. ");
getch();
return;
}else{
deletenode = thisptr;
printf("Customer Name %s has been removed!.\n", deletenode->name);
thisptr = thisptr->nextptr;
free(deletenode);
}
}