In C++ it seems like every single time you open a file, the inner contents get deleted quickly. Is there a way to open the file at the end of the last character while keeping all contents within the file? I've been looking at something with the End of file function but I don't know if that's the right way to go. Any advice?
Writing is implied. The behavior described is default behavior for an output file stream (an ofstream).
When you open an output file, it's default mode is ios::out|ios::trunc. An input file stream (ifstream) doesn't behave like that, its default mode is ios::in. To prevent this default output stream behavior, you need to change the output mode from truncate to append. To do that, you need to override the default value applied to the mode parameter by the function definition. The new mode value needed is ios::out|ios::app.
There are 2 types of "pointers" into files; a put pointer used for output and a get pointer used for input.
An input file stream (ifstream) relies on a get pointer. If you place a file's get pointer at the end of the file, it doesn't matter how, or how many times, you try to read the file, you'll always get EOF instead of any useful input. You'll have to do a seekg() to reposition the get pointer and begin getting anything useful.