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) {
|
void cancel_train(struct car* first) {
|
||||||
if(first!=NULL){
|
if(first!=NULL){
|
||||||
first=first->next;
|
struct car* temp= first;
|
||||||
free(first->next);
|
struct car* next;
|
||||||
cancel_train(first);
|
while(temp!=NULL){
|
||||||
|
next=temp->next;
|
||||||
|
free(temp);
|
||||||
|
temp=next;
|
||||||
|
}
|
||||||
|
first=NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user