add
This commit is contained in:
parent
df034f6c6d
commit
61443227a5
@ -1,4 +1,5 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -43,9 +44,10 @@ void cancel_train(struct car* first) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(first->next != NULL){
|
else if(first->next != NULL){
|
||||||
cancel_train(first->next);
|
struct car* help = first->next;
|
||||||
first->next = NULL;
|
|
||||||
free(first);
|
free(first);
|
||||||
|
cancel_train(help);
|
||||||
|
//first->next = NULL;
|
||||||
}
|
}
|
||||||
else if(first->next == NULL){
|
else if(first->next == NULL){
|
||||||
free(first);
|
free(first);
|
||||||
|
Loading…
Reference in New Issue
Block a user