car
This commit is contained in:
parent
68a3b21ba9
commit
79d7a7636d
@ -40,15 +40,12 @@ void print_train(struct car* first) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cancel_train(struct car* first) {
|
void cancel_train(struct car* first) {
|
||||||
if(!first){
|
if(first == NULL){
|
||||||
return NULL;
|
return;
|
||||||
}
|
}
|
||||||
struct car* help = cancel_train(first->next);
|
if(first->next != NULL){
|
||||||
if(first->value != NULL){
|
cancel_train(first->next);
|
||||||
first->next = help;
|
first->next = NULL;
|
||||||
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