Problem with file output

Hello everybody, here is my problem
i have some file which contain random data
for example:

sadasjdgjdsdfsdffsdsasdrgfsdfjdfjkbdkjf
....

how i can insert random character as first character
of this file

csadasjdgjdsdfsdffsdsasdrgfsdfjdfjkbdkjf....

please help, and sorry for my english=)
The only way I know how to do that is to read the file into a buffer, then using ios::trunc put your new output into the file, and then the contents of the buffer.

Perhaps someone knows a better way to do this than me...
No, there's no other way.
The only file operations are clear, append, and changing the value of random bytes.
Topic archived. No new replies allowed.