Hi everyone,
I think the quickest way to access a portion of a file is to structure it,
then use the fseek function from stdio.
In the case we are considering, the data for each room should be about the
same size. For example, if the data for a room is 500 bytes, each room's
data can be stored in a file at 500 byte intervals, then accessed using the
standard library routines. So to access room 50, you would set the file
pointer at 50 x 500.
fseek(room_file_pointer, room_number * 500, SEEK_SET);
If the data for each object is large, several files may be needed, maybe
with an index file.
Kev.
|