This commit is contained in:
Radovan Kofira 2020-11-05 19:39:07 +01:00
parent 74b4733ee1
commit cecb28932b

View File

@ -14,11 +14,12 @@
struct car* add_car(struct car* first,const char* target) {
struct car* newcar = calloc(1,sizeof(struct car));
struct car* temp=first;
struct car* this=first;
int length=0;
while(temp!=NULL){
if(temp->next!=NULL){
temp=temp->next;
while(this!=NULL){
if(this->next!=NULL){
this=this->next;
this->next = newcar;
}
length++;
}