C Programming computer science homework help

Consider the following program fragment that defines a self‐referential type:

//Start of code

#include <stdbool.h>


#include <stdlib.h>



struct node_int;



typedef struct node_int *node;



struct node_int



{



int data;



node next;



};



typedef struct list_int {node first;} *list;







int f1(list l)



{



node c=l->first;



int s=0;



while (c != NULL)



{



s=s + l->first;



c=c->next;



}



return s;



}



//End of code



Question 1: Thoroughly explain what does the function f1() do (or should do if it were free of errors)?



Question 2: Describe possible problems with the code of the function f1().

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.