update cv4
This commit is contained in:
parent
31878a2ae7
commit
8fb4fea3ec
@ -64,9 +64,10 @@ struct car* clear_train(struct car* first, const char* target)
|
||||
}
|
||||
if(first->next == NULL)
|
||||
{
|
||||
if(strcmp(first->value, target))
|
||||
if(!strcmp(target, first->value))
|
||||
{
|
||||
free(first);
|
||||
//first = NULL;
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
|
@ -22,7 +22,7 @@ int main()
|
||||
|
||||
printf("Zadajte stanicu, ktorá sa má vyradiť:\n");
|
||||
scanf("%s", buf);
|
||||
clear_train(train,buf);
|
||||
train = clear_train(train,buf);
|
||||
|
||||
print_train(train);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user