hi all,
i've been trying to edit a binary file so can i use seekp to be at the position where iwant to edit and then use put() to edit or this will just add a new charcter rather than editing that character
??????????
It will overwrite what is already there. You can't insert characters into the middle of a file. You would have to manually shift everything up to make room.
@Galik
what i mean is that if there was a character ( c ) in that position i want to make it any other one (z) for example. i don't want to insert z before or after the charcter (c )
so it would make what????
tanks for your reply
I think you need to close your output file before you open it for input. It probably has not made the change on disk because its still waiting in the buffer.
Try adding out.close(); after you made your changes and before you open the file for input.