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:

Students.dat containing:

Registers -> Name of Student (char[50])
Last Name of student (char [50])
Students ID (unsigned int)
Students Adress (char[100])
Students Phone number (char[30])
Students Postal Code (unsigned int)

Courses.dat containing:

Registers -> Course code number (unsigned short)
Course name (char[50])

Inscriptions.txt containing:

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!

THe best tutorial I can think of is your course notes and your textbook. Or are you missing both?
At least show us what you already have. Please?

Sorry, its in Spanish :S

And I couldnt attend to the last classes due to being sick, thats why Im too lost on the subject. Ive been trying to find tutorials all around the web, but Ive only found some vague ones without any real examples, and only found some in the files topic. I need to know more about Bit Operations (Shift registry, Masks). I'm sorry that I cant give out any more info, I dont have it.

Sorry, its in Spanish

I think you are referring to your course notes here.
I hope you can read your own language : Habla espagnol?

Ive only found some vague ones without any real examples

I googled with bit operations in C the first hit I got was


which looks to me a very good explanation of bit operations. Correct me if I am wrong.

Wow, thanks a lot. What I meant about my notes it's that it is a lot for me to write here, and if I scanned you wouldnt understand.

BTW it's espaƱol not espagnol o.O.

He meant for you to look at your notes. Doesn't using the resources you have make sense?

The thing is I didnt attend to those classes, if you have read my previous post you would have known. Unless I didnt express myself properly. The fact is Im totally lost on the subjects, but that tutorial was a nice start.

commented: I admire your self-defense-ed-ness. +3