Изменил(а) на 'cv4/a_train.c'
This commit is contained in:
parent
036b9fbe75
commit
e08472fa25
@ -4,12 +4,12 @@
|
|||||||
#include "a_train.h"
|
#include "a_train.h"
|
||||||
|
|
||||||
struct car* add_car(struct car* first, const char* target){
|
struct car* add_car(struct car* first, const char* target){
|
||||||
if(!strcmp(target, "") && !first)
|
if(!strcmp(target, ""))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
struct car* temp = first;
|
struct car* temp = first;
|
||||||
|
|
||||||
while(temp->next != NULL)
|
while(temp != NULL)
|
||||||
temp = temp->next;
|
temp = temp->next;
|
||||||
|
|
||||||
temp->next = (struct car*)calloc(1, sizeof(struct car));
|
temp->next = (struct car*)calloc(1, sizeof(struct car));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user