delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/04/22/11:15:45

From: "smiggy" <ms001a8758 AT blueyonder DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: reading file into structure
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Message-ID: <OwxE6.4214$R47.394400@news1.cableinet.net>
Date: Sun, 22 Apr 2001 09:30:22 GMT
NNTP-Posting-Host: 62.30.1.77
X-Complaints-To: http://www.blueyonder.co.uk/abuse
X-Trace: news1.cableinet.net 987931822 62.30.1.77 (Sun, 22 Apr 2001 10:30:22 BST)
NNTP-Posting-Date: Sun, 22 Apr 2001 10:30:22 BST
Organization: blueyonder (post doesn't reflect views of blueyonder)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

ive been given the following problem and i am having problems reading the
data from a file into a struct...

Descripion:

A number of simple student records are written to a text file.
One student record occupies a line of text.
Each record consists of four fields (items of data)1 separated by commas.
The fields are:
Family name
First name
Registration number' (8 characters~ JMU style)
Date of birth (in the form mm~d-yy).

The first two characters in the registration number refer to the year of
entry. The form of a typical line is
Bloggs, Fred, 00567843,12-05-78

Task (1)

Using a text editor, create a file with 10 such records, all different, with
registration years spanning both millennia, and in a fairly random order.
(The order should look random because one of the tasks is to sort the
records in chronological order).

Task (2)

Write a C program which reads the data and allows the user to browse the
data record (student) by record, allowing the user to specify First Last
Previous and Next. The fields (items of data) should be separately
displayed.

Task (3):

When the user specifies Sort, the records are sorted in chronological order
(i.e. by year of entry). The sort must take account of the fact that the
first two digits in the registration number denote year and that the
chronological sequence was 97, 98,99,00,01,02 and so on.

if anyone can give me any pointers i would be very greatfu...

smiggy


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019