how to delete data from the file
I had a file here, and I want to go through the data in the file. Some data in the file don't need anymore, and we need delet those data and those related data as well. I want to know hoe to delete those data (and those related data) from the file. Anyone can help me out?
Thank you for your time.
P.S The file is not predefined file, and user could get the file from any directory. I have codes here for browsing the file in the directory (only for your reference)
CString text2 = dlg.m_Text2;
pik_in = fopen(text2, "r");
.
.
.
.
Re: how to delete data from the file
Create another temporary file for writting and you will write all the data you want. Then, after reading from the data file, you can rename the temporary file to the data file. Hope this will give you some hints. Good luck.
Allen
Re: how to delete data from the file
thank you for your respond. Do you think you can show me how to really create a temp file and put data into the temp file?