This commit is contained in:
Maryna Kravtsova 2020-11-03 22:07:29 +01:00
parent d623d8b2ba
commit 3a8404ccf4

View File

@ -80,18 +80,8 @@ struct car* clear_train(struct car* first, const char* target) {
else{
struct car* this = first;
while(this!= NULL){
//while(this != NULL){
int x = strcmp(this->next->value, target);
if(x == 0){
struct car* temp = this->next->next;
this->next = NULL;
this->next = temp;
return this;
}
this = this->next;
//}
/*int x = strcmp(this->value, target);
while(this->next!= NULL){
int x = strcmp(this->value, target);
if(x == 0){
struct car* curr = first;
struct car* prev = NULL;
@ -108,7 +98,7 @@ struct car* clear_train(struct car* first, const char* target) {
prev->next = curr->next;
free(this);
}
this = this->next;*/
this = this->next;
}
}
return first;