well, I did a program that reads as many lines of the file you specify. the program is 99% perfect but this little bug is stressing me.
if you would like to see the bug you could test it , creating a txt file on your desktop and write 10 lines and test it. it double write a message and I don't want it to double write it D:, here is the code and I specified the line wich double print.
On line 27, you have cin >> c. This leaves a newline character in the stream which is picked up by the call to getline on line 46. The program considers this input, so it runs another loop, which is why your line is printed twice.
You can simply discard that extra newline with either cin.ignore() (more flexible) or cin.get() (only one character).
Also, why confuse the user by saying "press ENTER to quit", when you quit only if the user enters 'Q' or 'q'? (This will also cause trouble if the user enters the ASCII equivalents.)