update and delete the record from text

how to use the c++ to write the code :
case 1: how to write the code for update the record (string) from the text file.
can anyone show me some simple c++ code example.


case 2: how to write the code for delete the record (string) from the text file.
can anyone show me some simple c++ code example.


It probably won't be simple.

One approach is to read the entire file into a vector. Make whatever changes you like to the vector. Then save the contents of the vector back to the file.
can you write out the code.
update code
delete code
and explain line by line

i just i want a example to understand.
If you need such thorough examples, then you really should be consulting your textbook, or look for an online tutorial. There is a tutorial on this site which covers the basics of C++ but doesn't get into the more advanced topics which you are asking about.
Topic archived. No new replies allowed.