train2
This commit is contained in:
parent
9ff85b4bc3
commit
20fc5fc559
@ -32,16 +32,20 @@ void print_train(struct car* first) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cancel_train(struct car* first) {
|
void cancel_train(struct car* first) {
|
||||||
|
struct car* this;
|
||||||
if(first == NULL){
|
if(first == NULL){
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
if(first->value == NULL){
|
else{
|
||||||
//struct car *this = first->next;
|
this = first;
|
||||||
free(first);
|
first = this->next;
|
||||||
}
|
free(this);
|
||||||
cancel_train(first->next);
|
cancel_train(first->next);
|
||||||
free(first);
|
free(first);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct car* clear_train(struct car* first, const char* target) {
|
struct car* clear_train(struct car* first, const char* target) {
|
||||||
|
Loading…
Reference in New Issue
Block a user