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
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
"Yes, I rather like this God fellow. He's very theatrical, you know, a pestilence here, a plague there. Omnipotence. Gotta get me some of that."
- Stewie Griffin
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.