Every time I try to do this I get a unhanded exception at the if statement? everything else up to that point works fine.
void DeleteEmp(struct node* head, int tempID){
struct node *curNode = head;
struct node *prevNode = NULL;
while (curNode != NULL) {
if(curNode->empId == tempID) { // error here
free(curNode);
printf("Employee %d removed from database", tempID);
}
prevNode = curNode;
curNode = curNode->next;
}
}