Creating .txt file using it and deleting it

Hello
My name is William and I have being programing with c++ for three months now.
I am creating a program that makes a .txt file (using the fstream) library and use that file for calculations but I want that file to get deleted from the computer straight after it is used because in the actual program I make use of several files that I create to do different calculations and at the end of running the program I will be left with a lot of files which I don't think looks nice.

thank you




One option, see remove:
http://www.cplusplus.com/reference/cstdio/remove/

Another option. Rather than creating temporary files and deleting them afterwards, consider using a stringstream for temporary storage.
http://www.cplusplus.com/reference/sstream/stringstream/


(It might even be better to use one of the standard containers such as std::vector or std::list, but that could require some rethink of your design).
Topic archived. No new replies allowed.