15%
This commit is contained in:
parent
e70abbc8cd
commit
3f9d54d44a
@ -16,10 +16,12 @@ 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;
|
||||||
int length=0;
|
int length=0;
|
||||||
while(this!=NULL){
|
if(this==NULL){
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
else(this->!=NULL){
|
||||||
this=this->next;
|
this=this->next;
|
||||||
this->next = newcar;
|
this->next = newcar;
|
||||||
length++;
|
|
||||||
}
|
}
|
||||||
strcpy(newcar->value, target);
|
strcpy(newcar->value, target);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user