I had a question about files. I wanted to know how to command the text to be outputted on a separate page in the "file.doc" file after each iteration. So for example, in the first iteration, let's say I put the name Kyle. As a result, Kyle would be outputted onto the first of file.doc. Then, in the second iteration, I put the name 'Cassidy.' From there, Cassidy would be outputted onto the page #2 of 'file.doc' and so on and so on. Could someone please show me how to do this if possible? Thank you
"Page" is not a well-defined term for a text file, which is what you're currently writing (not an actual Microsoft Word document).
However, it seems Microsoft Word knows how to open a plaintext file with special control characters like Form Feed to mean "new page".
If you want fancy mark-up, there is also LaTeX, which can be written in plaintext markup and then compiled into a PDF or similar. https://www.latex-project.org/
_________________________________
If you want to append to a file between program runs without overwriting it, use std::ios::out | std::ios::app in your constructor.
You're not writing a DOC file, you're writing a plain text file named "file.doc". DOC files are binary and have a complex format. It's not something you're prepared to deal with right now.
Now, ASCII provides the character "form feed", which the display device is supposed to interpret as a new page. For example: