Home > Back-end >  MFC C PC to write data into the TXT file
MFC C PC to write data into the TXT file

Time:09-26

void Cchuankou2Dlg: : OnBnClickedButton1Conserve ()
{
//TODO: add the control notification handler code

CFile file;

WCHAR * pFileName=L "E: \ \ a.t xt";
Cstrings string;

Int * p=& amp; M_accx;

The string. Format (_T (" % d "), * p).

File. The Open (pFileName CFile: : modeWrite);

File. The Write (string, string. GetLength ());

File. The Close ();
}

Above as the source program, I am using vs2010, int variable m_accx value for the decimal number 1234 to run the program after the TXT file shows only 12, is this why?
Everybody to help, don't appreciate

CodePudding user response:

File. The Write (string, string. GetLength ());
-- -- --
"File. The Write (string, string. GetLength () * sizeof (TCHAR));
  • Related