If you’re stuck on the ID3 tag part of the project, this might give you some ideas.

In this lab, you can get some practice with a simple struct and reading/writing instances of it to/from a file.

Getting the materials

First, make a lab2 directory in your ~/private/cs0449 directory like you did for lab1.

Then, cd into it and run this command to get the files:

cp ~jfb42/public/cs449/lab2/* .

Don’t forget the space and period in the above command.

Compiling and running

Compiling a C program with two files is simple – just list both programs on the GCC commandline.

gcc -Wall --std=c99 -o lab2 lab2.c driver.c

Do not list lab2.h on the command line. We only compile C files.

If you do this with the unmodified files, the resulting ./lab2 executable will do nothing.

What to do

Implement the functions in lab2.c. Follow the directions in the comments, and remove the comments as you go.

Start from the top function (open_database) and work your way down. As you do so, you will be able to use more and more features of the driver program.



Remember the instructions you learned last time?

Follow those, but replace lab1 with lab2.