Do you honestly write code like that? No offence meant; but by "wrap your code in [co
de] tags" I meant so that it was indented... Anyway;
Why are you doing it like that? There is a much shorter, quicker, more standard and more readable method, like the way I showed you.
It would be much easier if you did it the way I showed you. That places the whole file into
buffer which is an array of strings big enough to hold the whole file. Then you read through the file, placing lines into the buffer. When you've done that, you find the appropriate line and delete it, and the next line, from the file. Then you rewrite the file, removing the contents of the original file, such that you are left with the same file but with those two lines missing.
Don't use system("pause") either. Use
std::cin.get();
which will do almost the same thing but in a better and more standard way. Using std::cin.get(); your program will wait until the enter key is pressed; which is preferable to using the operating system to do the same thing. It will take much longer and is in fact fairly insecure. What do you think would happen if someone put a file called pause.exe in the same directory as your own program? You would run it. Try not to use system(anything);. It's bad practice.
Read:
http://cplusplus.com/forum/articles/10515/
http://cplusplus.com/forum/articles/11153/