train2
This commit is contained in:
parent
96151e5e3b
commit
9ff85b4bc3
@ -32,14 +32,14 @@ void print_train(struct car* first) {
|
||||
}
|
||||
|
||||
void cancel_train(struct car* first) {
|
||||
struct car *this = first->next;
|
||||
if(first == NULL){
|
||||
exit(0);
|
||||
}
|
||||
if(first->value == NULL){
|
||||
//struct car *this = first->next;
|
||||
free(first);
|
||||
}
|
||||
cancel_train(this->next);
|
||||
cancel_train(first->next);
|
||||
free(first);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user