This commit is contained in:
Maryna Kravtsova 2020-11-02 11:42:12 +01:00
parent cb21f01ac7
commit fdde562ecf

View File

@ -20,11 +20,10 @@ struct car* add_car(struct car* first,const char* target) {
void print_train(struct car* first) {
struct car* this = first;
/*if(first == NULL){
if(first == NULL){
exit(0);
}*/
//else{
if(first != NULL){
}
else{
while(this != NULL){
printf("%s\n", this->value);
this = this->next;
@ -38,9 +37,9 @@ void cancel_train(struct car* first) {
exit(0);
}
else if(first->next == NULL){
this = first;
first = first->next;
free(this);
//this = first;
//first = first->next;
free(first);
first = NULL;
}
else{