diff --git a/cv4/a_train.c b/cv4/a_train.c index 9b2a408..a3e46e1 100644 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -1,11 +1,12 @@ #include #include"a_train.h" -/////@ + struct car* add_car(struct car* first,const char* target) { + struct car* ret = first; struct car* nc=(struct car*) malloc(sizeof(struct car)); strcpy(nc->value, target); nc->next=NULL; @@ -17,7 +18,7 @@ struct car* add_car(struct car* first,const char* target) first=first->next; } first->next=nc; - return first; + return ret; } first=nc;