Изменил(а) на 'cv4/a_train.c'
This commit is contained in:
parent
cd1b052dba
commit
40192942a1
@ -16,12 +16,12 @@ struct car* add_car(struct car* first, const char* target){
|
||||
|
||||
struct car* temp = first;
|
||||
|
||||
while(temp != NULL)
|
||||
while(temp->next != NULL)
|
||||
temp = temp->next;
|
||||
|
||||
temp = (struct car*)calloc(1, sizeof(struct car));
|
||||
strcpy(temp->value, target);
|
||||
temp->next = NULL;
|
||||
temp->next = (struct car*)calloc(1, sizeof(struct car));
|
||||
strcpy(temp->next->value, target);
|
||||
temp->next->next = NULL;
|
||||
return first;
|
||||
}
|
||||
|
||||
@ -73,13 +73,4 @@ struct car* clear_train(struct car* first, const char* target){
|
||||
}
|
||||
|
||||
return first;
|
||||
}
|
||||
|
||||
/*int main(){
|
||||
struct car* myCar = (struct car*)calloc(1, sizeof(struct car));
|
||||
myCar = add_car(myCar, "Kosice");
|
||||
print_train(myCar);
|
||||
myCar = clear_train(myCar, "Kosice");
|
||||
print_train(myCar);
|
||||
return 0;
|
||||
}*/
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user