Question: (Building an array of linked lists - 20 points): Assuming you got split_line() working, complete build_lsts() that builds a list of clips. When building a

(Building an array of linked lists - 20 points): Assuming you got split_line() working, complete build_lsts() that builds a list of clips. When building a list, append a clip at the end of the list. struct clip { int number; int views; char *user; char *id; char *title; char *time; struct clip *next; }; struct clip *hourly[MAX_CLIPS]; void build_lsts(char *prefix) { FILE *fp; char *cmd,*filename; int i; for (i=0;i

/* open the file, read a line at a time, call split_line() to split the line and store in fields, malloc a clip, set values to clip BUT SET VIEWS ONLY remember views is int, not char *, and append the clip at the end of the list */ struct clip *build_a_lst(char *fn) { FILE *fp; char *fields[5]; char line[LINE_LENGTH]; struct clip *hp=NULL, *cp, *tp; /* tp for new clip, cp for traversing */

return head;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!