15%
This commit is contained in:
parent
74b4733ee1
commit
cecb28932b
@ -14,11 +14,12 @@
|
|||||||
|
|
||||||
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* temp=first;
|
struct car* this=first;
|
||||||
int length=0;
|
int length=0;
|
||||||
while(temp!=NULL){
|
while(this!=NULL){
|
||||||
if(temp->next!=NULL){
|
if(this->next!=NULL){
|
||||||
temp=temp->next;
|
this=this->next;
|
||||||
|
this->next = newcar;
|
||||||
}
|
}
|
||||||
length++;
|
length++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user