Question: Is there any way you could change this code up so that it does the same thing just looks different. Its written in C programming.
Is there any way you could change this code up so that it does the same thing just looks different. Its written in C programming.
void *do (void *point, void *thing)
{
list *ins= point;
int i;
if (strcmp(ins->data,"NULL")==0)
{
strcpy((ins->data), (char*)thing);
ins->next = point;
return ins;
}
while (ins->next != point)
{
ins = ins -> next;
}
ins->next = (list *) malloc(sizeof (list));
ins = ins->next;
strcpy(ins->data, (char*)thing);
ins->next = pointer;
return ins->next;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
