Erasing a file

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++
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?
 
#include <stdio.h> 


defines

 
int      remove(const char *);
Topic archived. No new replies allowed.