I am writing a program in C++ which opens, parses, and formats a text file. I would like to know if there is a way that I could open the text file, check and see if there a new line at the end of the file, and add one if it is not present.
I am very new to C++, and I am not sure how to tackle this. Could someone please provide a demo?
Thank you for your time!
To build on paulsm4’s answer: