clear
This commit is contained in:
parent
292d002348
commit
3983947573
@ -28,7 +28,7 @@ struct car* add_car(struct car* first,const char* target) {
|
|||||||
|
|
||||||
void print_train(struct car* first) {
|
void print_train(struct car* first) {
|
||||||
for(struct car* this = first; this != NULL; this = this->next){
|
for(struct car* this = first; this != NULL; this = this->next){
|
||||||
printf("%s ", this->value);
|
printf("%s\n", this->value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,22 +82,6 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
}
|
}
|
||||||
prev = prev->next;
|
prev = prev->next;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if(prev->next->next == NULL) {
|
|
||||||
int x = strcmp(first->value, target);
|
|
||||||
if(x == 0){
|
|
||||||
prev = first->next;
|
|
||||||
free(first);
|
|
||||||
return prev;
|
|
||||||
|
|
||||||
}
|
|
||||||
x = strcmp(prev->next->value, target);
|
|
||||||
if(x == 0){
|
|
||||||
struct car* third = prev->next->next;
|
|
||||||
free(prev->next);
|
|
||||||
prev->next = third;
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
return first;
|
return first;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user