This commit is contained in:
Maryna Kravtsova 2020-11-05 16:07:56 +01:00
parent 292d002348
commit 3983947573

View File

@ -28,7 +28,7 @@ struct car* add_car(struct car* first,const char* target) {
void print_train(struct car* first) {
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;
}
/*
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;
}