Guest_imported
New member
- Jan 1, 1970
- 0
Hi, I currently need help on the seekg command. The problem is that I do not know how to write information to a file in the same block size (I am using random access)
for example:
I want to search the 9th and 17th object in a file:
---------------------------------------------------
A
B
C
D
...
X
Y
Z
---------------------------------------------------
the 9th and 17th should be I and Q
I used the command fin.seekg(9, ios::beg);
there wasn't any errors but it outputted D instead...
the object of my program is to find the I and Q and replace them to X. If anyone of you need to look at the source code i will post it here again... thank you.
for example:
I want to search the 9th and 17th object in a file:
---------------------------------------------------
A
B
C
D
...
X
Y
Z
---------------------------------------------------
the 9th and 17th should be I and Q
I used the command fin.seekg(9, ios::beg);
there wasn't any errors but it outputted D instead...
the object of my program is to find the I and Q and replace them to X. If anyone of you need to look at the source code i will post it here again... thank you.