clear
This commit is contained in:
parent
d623d8b2ba
commit
3a8404ccf4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user