thicken
asked on
Database Structure
Hey guys. A friend of mine lent me a C programming book because I was interested and Ive been doin pretty well so far until I stumbled upon a program involving structures. I basically have to create a database. Ive read examples but can't seem to grasp it. Heres the problem:
Write statements that accomplish each of the following. Assume that the structure:
struct person {
char lastname [15];
char firstname [15];
char age [4];
};
has been defined and that the file is already open for writing.
a)Initialize the file "nameage.dat" so that there are 100 records with lastname = "unassigned", firstname = "" and age = "0".
b)Input 10 last names, first names, and ages, and write them to the file.
c)Update the record. If no record tell the user "no info".
d)Delete a record that has data by reinitializing that particular record.
Write statements that accomplish each of the following. Assume that the structure:
struct person {
char lastname [15];
char firstname [15];
char age [4];
};
has been defined and that the file is already open for writing.
a)Initialize the file "nameage.dat" so that there are 100 records with lastname = "unassigned", firstname = "" and age = "0".
b)Input 10 last names, first names, and ages, and write them to the file.
c)Update the record. If no record tell the user "no info".
d)Delete a record that has data by reinitializing that particular record.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER