delete input from user

Hi..i am currently crating a system where user input their sales record into a system.I have done the add function and now i have some problems with the delete part.I read that to delete i have to create a temp file and input all the values from the original text file into the temp file.

My code is for input is:

ofstream database;
database.open ("database.txt", ios::app);
cout << "Pls enter item\n";
cin >> ItemDesc;
database << ItemDesc << ":";
cout << "Pls enter Qty\n";
cin >> Qty;
database << Qty<< ":";
database.close();

So the output should be eg: Book:12
my qn is..how to do call these 2 values together as a whole to be deleted?is there a way to call once a user enter "Book"the qty will also be deleted with it as well?

thanks!
Topic archived. No new replies allowed.