This is my first post here. I am writing a program in C++ using file handling in which I have a given text file and I wish to delete everything in the file beyond a certain point at which my pointer is, after which the pointer should return to the same plae as before.
If anyone can help me I will be greatly obliged. I have not programmed in a long time.
Specifically in my program, I have,
...
ofstream List;
List.open("List.txt");
...
List.seekp(i);
At this point I wish to delete everything in the file beyond the ith byte, and ensure that whatever further I write is from the ith place. How do I do that?
Thanks.