Hello, this is my first post here, so thanks for your time and comprehension.
English isnt my first language, so I'll be trying my best.
OK, I'm in need for a tutorial where I can find examples on how to make use of files, bit operations and registers(whats a register :P?). I got an exam in 3 days and thats the only topic I'm having trouble with.
I have a sample examination in my hands, a point asks you to use registers in .dat files and using also a .txt file written in CSV (Comma separated values) you have to get info from the .dat file that matches that of the .txt file.
Ill try to translate it:
Registers -> Name of Student (char)
Last Name of student (char )
Students ID (unsigned int)
Students Adress (char)
Students Phone number (char)
Students Postal Code (unsigned int)
Registers -> Course code number (unsigned short)
Course name (char)
CSV -> Course code number (numeric value)
Career's Year the course is available (numeric value)
Career code number (numeric value)
Students ID (numeric value)
Students Situation (character: Passed 'p', Flunked 'f', Currently Coursing 'c')
Inside the Courses.dat file, the Course code number contains the following information:
Bits 0, 1, 2, 3, 4: Course Number
Bits 5, 6, 7: Year in the career this course belongs to.
Bits 8, 9, 10: Carrer's Code number (1: Electronics, 2: Mechanics, 3: Chemistry, 4: Construction, 5: Biology)
Bits 11, 12 are of no use.
Bit 13: Indicates the duration of the course (0 for 6 months, 1 for a year)
Bit 14: Indicates in which half the Course starts ( 1 First half, 0 Second half)
Bit 15 is of no use.
And then they ask you to make the following functions
1) A function that receives as parameter the name of a course and then prints a list of students (Name, Last name and ID) who failed the course.
2) A function that receives the last name of a student and prints a list of all the courses the student coursed in the past or is still coursing, all info on each course being showed.
Damn, its a long read and I appreciate if anyone could help me out on this one, or even a link to a tutorial where I could find help can be useful. Thanks a lot for reading this!