Ei Bros, I really need your help. There's this program I've been trying to figure out for 2 days but bisag unsaon, I really can't solve it.
Program 1 Specification:
The program will read any file of student records whose file name is inputted by the user. Each student record contains the following fields:
1) ID – unsigned long
2) Name – structure containing the following fields
a. Lastname – 16 characters
b. Firstname – 24 characters
c. Middle Initial – 1 character
3) Course – 8 characters
4) Year – integer
The program displays the student records read from the file:
using the following format:
Record No. ID Lastname Firstname MI Course Year
1 111111 Dela Cruz Juan A. BSIT 2
2 3456746 Tan Carole Jane F. BSCS 3
20 records are displayed at a time, i.e. the first 20 records are displayed, then the next 20 , and so on.
The program will contain at least 2 functions:
DisplayHeader – this will display the following header :
Record No. ID Lastname Firstname MI Course Year
DisplayRecord – this function will accept as parameter a single student record and displays on all screen all data in the record in 1 row.
To check if the program will execute correctly, 3 sample files are given:
file1.dat
file2.dat
file3.dat
Program 2 Specification:
The program will create a file of N student records whose name and number of records N are to be inputted by the user.
Each student record will contain fields which are the same as program 1.
The program should contain at least 2 functions:
GetRecord – will allow user to input from the keyboard all information in a single record and return it to the calling function.
DisplayRecord – this function will accept as parameter a single student record and displays on all screen all data in the record in 1 row. This function will be used to check if all data are correct before writing to the file.
Use Program 1 to check if Program 2 is correct.
My problem jud is the "fread" syntax.
Any help would be gladly appreciated.
Thanks...