Ok, I re-wrote some of it, but I have a few things I do not understand, so maybe yall can help me with that. By the way, thank yall for the suggestions and comments on the program.
@The Dark: I found a function that tells me the size of the file in bytes. For every byte that is in the file, I write one 0 so that it is overwritten. (I think one char is one byte) For example:
Quote:
|
Originally Posted by Original File
My name is Bob the Tomato.
|
turns into
Quote:
|
Originally Posted by Modified File
0000000000000000000000000
|
. I was wondering, if I use ios::/out (/ added because of stupid smiley) as an ofstream flag, is this the same as calling ios::trunc? And why is it a bad thing to truncate the file if it still exists? I thought it would be safe as long as the file still exists on the hard drive, obviously it would be un-safe if the file had been deleted somehow.
@nnxion: I took out the #included .cpp file and defined it in my source. I was trying to save space when I posted the source on the forums, not a big deal though. The KillProcess() code accepts a filename, as far as I was aware. Perhaps I need to re-read that whole function and see if I missed something.
@IR: I had that in the loop because I originally was overwriting the file over and over again, but now it just overwrites it once.
Thanks again for helping me out with this.
My updated code is attached.