17%
This commit is contained in:
parent
faa298fa9e
commit
3ac07444f5
@ -15,6 +15,7 @@
|
|||||||
struct car* add_car(struct car* first,const char* target) {
|
struct car* add_car(struct car* first,const char* target) {
|
||||||
struct car* newcar = calloc(1,sizeof(struct car));
|
struct car* newcar = calloc(1,sizeof(struct car));
|
||||||
struct car* this=first;
|
struct car* this=first;
|
||||||
|
strcpy(newcar->value, target);
|
||||||
if(this==NULL){
|
if(this==NULL){
|
||||||
return newcar;
|
return newcar;
|
||||||
}
|
}
|
||||||
@ -22,7 +23,6 @@ struct car* add_car(struct car* first,const char* target) {
|
|||||||
this=this->next;
|
this=this->next;
|
||||||
}
|
}
|
||||||
this->next = newcar;
|
this->next = newcar;
|
||||||
strcpy(newcar->value, target);
|
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user