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
Erasing a file
Erasing a file
Dec 17, 2008 at 10:16am UTC
mangeh
(1)
void rensafil(art *lager, int& skrivit){
fstream utFil;
utFil.open( "lager.txt",ios_base::in|ios_base::out|ios_base::trunc );
utFil.close();
}
Thats what i've come up with, to clear the text file lager.txt. Doesnt seem to work, any suggestions on how to do it? Using dex c++
Dec 17, 2008 at 10:42am UTC
helios
(17607)
Why do you take those parameters? They don't do anything.
If what you wanted to do was blank the file, that's working for me.
If you wanted to delete the file, oddly, the standard library doesn't provide a method to do that.
Odd, isn't it?
Dec 17, 2008 at 12:15pm UTC
kbw
(9488)
#include <stdio.h>
defines
int
remove(
const
char
*);
Topic archived. No new replies allowed.