QUOTE(polymath @ 15 Nov, 2008 - 08:07 AM)

that would be your problem. You need to read the entire file into memory and then overwrite the entire file. To do this open the file in an ifstream, read it into memory, manipulate, and then output.
Are you serious?
What if the file is for really BIG database and it's like 100MBs big?
That app will be a memory hog,instead of reading directly to memory.
You need to only create a temp file and name it what ever you want,read a string from the old file (one at a time) and compare then write it to the temp file.
Every line you get from old file will get compared to see if the name of the employee ur looking for has been readed,if it is then skip reading all the info and stuff about him.
and continue on with the next employee.
That way is easier,faster,better performance (since you won't use a lot of memory),you can use it to not only delete but edit and add info too. and best of all "easier to code".
I have done it that way and it works flawless.