How to random read/write the file in fstream?

Z

zhushenli

Hello all,

How to random read/write the file in fstream?
BTW, how to access the file in block?

Regards,
Davy
 
O

osmium

How to random read/write the file in fstream?

Open the file in binary mode and then use tellp, seekp when writing and
seekg.when reading. There is also a tellg but I am not sure that you will
need it. To get started it might be best to write a dummy record for each
record that may exist in the future. .
BTW, how to access the file in block?

I don't understand the question. "Block" has some meaning to you that I do
not share.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top