Classwork 11 - UMBC-CMSC104/General GitHub Wiki

We're going to practice using structs with this classwork. Please name your code struct_practice.c.

Make a struct that stores the following book information:

  • Title (string)
  • Author (string)
  • Number of pages (int)
  • ISBN (string)

Make a function that reads in this information into your struct and then make another function that prints it out.

Welcome to classwork 11!
Please enter the title of a book: A Deepness in the Sky
Please enter the name of the author: Vernor Vinge
Please enter the number of pages: 775
Please enter the ISBN number: 0-8125-3635-5

The book you have described is:
Title: A Deepness in the Sky
Author: Vernor Vinge
Number of pages: 775
ISBN: 0-8125-3635-5    

You will most likely need fgets for the title and the author.

To compile:

gcc struct_practice.c -o struct_practice

To submit:

submit cs104_wilson cw11 struct_practice.c