Does anyone out there know anything about random file access.
Does anyone out there know anything about random file access.
Yes. What do you want to know about it? It is more complicated that normal read, write or append methods. You have to keep track of your position in the file. If you do an insert, then you have to move every character after the insert, and vice versa for a delete.
Best Regards,
Bonkey
My teacher just had me start them, and I wasn't really sure where to start.
your teacher sounds like a dweeb!!! who is a MAC lover!!!!!
He does love a good MAC.
Last edited by bob20; 11-27-2002 at 09:30 AM.
All of this aside, can anyone tell me a good place to start into random file access.
>All of this aside, can anyone tell me a good place to start into random file access.
Start off with a file opened in binary mode. Make sure that every record is the same size, padded if the data doesn't fill the record, then you can calculate an offset for the file, go directly to it, and read the correct record:
file.seekg ( RECORD_SIZE * offset );
-Prelude
My best code is written with the delete key.