add
This commit is contained in:
parent
7d285ca052
commit
df034f6c6d
@ -40,14 +40,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){
|
||||||
exit(0);
|
return;
|
||||||
}
|
}
|
||||||
if(first->next != NULL){
|
else if(first->next != NULL){
|
||||||
cancel_train(first->next);
|
cancel_train(first->next);
|
||||||
first->next = NULL;
|
first->next = NULL;
|
||||||
//free(first);
|
free(first);
|
||||||
}
|
}
|
||||||
if(first->next == NULL){
|
else if(first->next == NULL){
|
||||||
free(first);
|
free(first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user