Create a CD Database in C programming
Posted on 2004-04-29
Need help in writing a program that uses structs to create and manage a simple database of information about CDs.
The struct should have information about the CD title (max length 20), CD author (max length 20), and CD length (in minutes and seconds, max 74 minutes and 60 seconds).
An infinite number of CD's should be able to be entered. I need the option to view all CDs that have been entered, enter new CDs, rewrite over any CD with new information, and delete a CD from database. All of these things need to be done with functions (i.e. a function for entering in a new CD, viewing CDs.)
All structs should be passed by reference, not by value.
In addition to the above I need to implement saving to a file and loading from a file. The user should not have the option to choose the filename that the data should be saved in-use cd.dat. The program should automatically load the file when run, but the user should have a menu option to save and another menu option to reload the file.
This is an outline of my program thus far...it has not been compiled yet.
Please offer any suggestions...
}struct CD *content
void ViewCDs(struct CD list*)
void InsertNewCD(struct CD new*)
printf("1. VIEW CD LIST\n");
printf("2. ENTER NEW CD\n");
printf("3. UPDATE CD INFO\n);
printf("4. DELETE CD\n");
printf("Choose a number from the menu above.\n");
fgets(buffer, sizeof(buffer), stdin);
sscanf(buffer, "%d", &entry);
printf("Choose an option from the men!\n");