I want to append new values to linked list tail, but for some reason it seems like the values are not getting appended. For new linked list allocation:
struct checkPoints *checkPt = *checkPoint;
while (checkPt != NULL) {
checkPt = checkPt->next;
}
if (checkPt == NULL) {
checkPt = malloc(sizeof (struct checkPoints));
scanf("%c %d %d %d %d\n", &checkPt->dropOut, &checkPt->currentPoint, &checkPt->competitor, &checkPt->hour, &checkPt->minute);
}
Ideas?
You aren’t adding your new item to the list (and also lose track of the end of the list when you allocate your new item). Try