ahh..
This commit is contained in:
parent
f4382afafd
commit
4fde774336
@ -36,9 +36,14 @@ void print_train(struct car* first) {
|
||||
|
||||
void cancel_train(struct car* first) {
|
||||
if(first!=NULL){
|
||||
first=first->next;
|
||||
free(first->next);
|
||||
cancel_train(first);
|
||||
struct car* temp= first;
|
||||
struct car* next;
|
||||
while(temp!=NULL){
|
||||
next=temp->next;
|
||||
free(temp);
|
||||
temp=next;
|
||||
}
|
||||
first=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user