Hi,
Is it possible to add items to the beginning of an existing file without overwriting the data that already exists in the file? I have tried using ios::app but that only seems to let me append the end of the file.
Cheers
Printable View
Hi,
Is it possible to add items to the beginning of an existing file without overwriting the data that already exists in the file? I have tried using ios::app but that only seems to let me append the end of the file.
Cheers
You have to do it manually. Probably the easiest way is to:
- Create a new file.
- Add the new content to your new file.
- Append the contents of the old file to the new file.
- Rename the new file to the old file.