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;



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().

"Is this question part of your assignment? We can help"