Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

2. DO change any clerical or calculation errors.

Answered: 1 week ago

Question

Identify sustainable HRM practices in an organization.

Answered: 1 week ago

Question

How would you describe the new culture?

Answered: 1 week ago