Reference no: EM132253263
Intermediate Programming Assignment - Binary Files and Structures on Disk
The Problem - Your task is to write a program that stores and retrieves structures in a file on disk. The file of structures must remain on the disk once your program ends. You should be able to store structures to the file and retrieve from the file after restarting the program.
The record that you will be writing to file has the following structure:
struct contact {
unsigned long phone_number;
long first_name_posn;
long last_name_posn;
long company_name_posn;
long email_posn;
long next;
};
first_name_posn, last_name_posn, company_name_posn, and email_posn are the position in the file of the First Name, Last Name, Company Name, and Email variable strings. These "locations" will be required for writing and reading the information to be stored. This struct definition cannot be altered in any way.
When you write the structures on disk, you will need to store the First Name, Last Name, Company Name, and Email strings separately from the contact structure. In the file you will write the contact structure first followed by the First Name, Last Name, Company Name, and Email strings (if they exist). The only required information is the Phone Number - all other information is optional.
The position "next" stores the location in the file where the next contact record is stored. This will function similarly to a linked list data structure, but will use "next" variable to facilitate the linking of records.
The file can contain any number of records and associated strings. The name of the file will be myContactList.db (and must match this exactly). If the file does not exist then your program must create it.
Coding Guidelines and Testing -
Assignments which do not compile with your makefile on the SOCS server will receive a grade of 0. You must use the -ansi and -Wall flag.
Any changes to the struct definition will result in a grade of 0.
Your makefile must produce an executable named contactList. It must be placed inside the bin/folder. See the Project Structure section for more details.
Function prototypes and struct definitions are expected to be inside the .h files for your project, and function definitions must be in a file without a main() function (ie. you will need at minimum two .c files and at minimum one .h file).
Attachment:- Assignment Files.rar
Skilled and unskilled and overall national share in steel
: Explain Employment- skilled/unskilled and overall national share in Steel , Aluminium and Automobile ?
|
Replacing a hard drive on a desktop computer
: What is the difference concerns between replacing a hard drive on a desktop computer vs a laptop computer?
|
Basic terms of object oriented programming
: Explain, using basic terms of object oriented programming, the principles being applied for the simple code snippets we have been developing
|
Explore how you plan to alter the tone of your writing
: Begin to explore how you plan to alter the tone of your writing so that it is less academic and more businesslike.
|
Write program that stores and retrieves structures in file
: CIS2500 Intermediate Programming Assignment - Binary Files and Structures on Disk, University of Guelph, Canada. Write program that stores structures in file
|
Python statements for three math expressions
: Then write three Python statements for the following three math expressions. Finally, calculate and print out the values of variables a, b, and c.
|
Prepare time-phased product structure
: Prepare a time-phased product structure. How long does it take to Produce S? Construct a Materiel Requirements Plan (MRP) using the following on-hand inventory.
|
What is probability that stock will go up given percentage
: An investment advisor recommends the purchase of shares in Infogenics, Inc as he expects that the stock of Infogenics would go up at least 20%.
|
Now that you''ve spent a little time with spreadsheets
: Now that you've spent a little time with spreadsheets, can you think of how things were done before spreadsheets? What tools were used
|