Hello,
I have a binary file with variable length record that looks about like this:
12 economic10
13 science5
14 music1
15 physics9
16 chemistry9
17 history2
18 anatomy7
19 physiology7
20 literature3
21 fiction3
16 chemistry7
14 music10
20 literature1
The name of the course is the only variable length record in the file, the first number is the code of the course and it can be a number between 1 and 9999 and the 2nd number is the department and it can be between 1 and 10. As you see in the file there is no space between the name of the course and the department number.
The question is how can I read from the binary file? There is no field in the file to tell me what is the size of the string which is the course name.. I can read the first int (course id) fine, but how do I know what is the size of the name of the course?
Thanks in advance,
Greg