Solved

Database Structure

Posted on 2006-11-21
2
593 Views
Last Modified: 2006-11-28
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.
0
Comment
Question by:thicken
2 Comments
 
LVL 25

Accepted Solution

by:
SStory earned 125 total points
ID: 17995290
Are you sure this isn't a homework assignment?
0
 

Author Comment

by:thicken
ID: 18000285
Nope. Been out of school for a year now. Does it matter if it is?
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now