Home > Back-end >  C method of the data within the TXT clearing, please answer!
C method of the data within the TXT clearing, please answer!

Time:10-01

As shown in figure is my search method to try, but an error, since the solution with an open mind.
I would like to store1 to 4 TXT file content clear,,

CodePudding user response:

Fopen (" your file name ", "w");
Open the success is empty,

CodePudding user response:

Is the cause of the error file variable name repetition to try try changing the file to other names

CodePudding user response:

Ah,,, each fstream file... Statements with big parentheses, example as follows:
{ fstream file (" E: \ \ ks \ \ store1 TXT ", the ios: : out); }

CodePudding user response:

reference 1st floor gouyanfen response:
fopen (" your file name ", "w");
Open the success is emptied,
conveniently fclose together made the
 fclose (fopen (" name ", "w")); 

CodePudding user response:

STD: : ofstream of;
Of the open (szPath, STD: : ios: : binary | STD: : ios: : trunc | STD: : ios: : out);
  • Related