cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Deleting data in a .txt file with C++
Deleting data in a .txt file with C++
Mar 16, 2012 at 7:50pm UTC
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?
Mar 16, 2012 at 7:53pm UTC
Stewbond
(2827)
Sure:
1
2
ofstream fout(
"somefile.txt"
); fout.close();
That will erase the contents of somefile.txt.
Last edited on
Mar 16, 2012 at 7:54pm UTC
Mar 16, 2012 at 8:21pm UTC
closed account (
365X92yv
)
Coolio, thanks.
Topic archived. No new replies allowed.