|
-
August 17th, 1999, 10:36 PM
#1
Read and write file
Hello:
I use VC++6.0 MFC.I want to open and read a file,and then
open and write to a file like this:
void CCodeChange1Dlg::ChangeCode()
{
CString str,str2;
CStdioFile Fillnput1(m_InputName,CFile::modeRead);
CFile fillnput2(m_OutputName,CFile::modeWrite|CFile::modeCreate);
fillnput1.ReadString(str);
str2.Format("%s\r\n",str);
fillnput2.Write((char*)(LPCTSTR)str2,str2.GetLength());
}
This is example the file char only one line.But when i test
the str2 can't read into file.Which is wrong?
Welcome any advice!
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|