Deleting data in a .txt file with C++

closed account (365X92yv)
Can you take a notepad file and using code in visual studio or any of the coding programs and delete anything that has been written in the notepad file?
Sure:
1
2
ofstream fout("somefile.txt");
fout.close();


That will erase the contents of somefile.txt.
Last edited on
closed account (365X92yv)
Coolio, thanks.
Topic archived. No new replies allowed.