Question: typedef struct { char * title; char * author; int year; } Book; Book * create _ library ( char * ) ; This function

typedef struct {
char *title;
char *author;
int year;
} Book;
Book *create_library(char *);
This function reads in book_list.txt (provided) and creates an array of 50 Book structs. It returns a pointer to this array.
void display_books(Book *);
This function takes the pointer to the array of books, and prints them to the screen.
void reverse_books(Book *);
This function creates a reversed book list and returns a pointer to the reversed array.
save_to_file(FILE *, Book *);
This function saves the reversed list to a file.
You will need to pass the name of the file on the command line and pass it as an argument to create_library(). You are free to implement helper functions if you wish.
Compile your program using: gcc -Wall -pedantic library.c -std=c90-o library
To run the program: ./library book_list.txt reversed_list.txt

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!