Hi,I write something to make it put a string to a file and read it out
afterward.But i found when i write in a string : "TestingTextForWrite" to
that file,I can only read the first character of that string,that's "T"
only,may I know how can i modify the code below to read the whole string i
write in that file?
CString Testing1;
CString Testing2 ;
Testing.Format(L"TestingTextForWrite");
//Write File Now
FILE *fp;
if((fp=fopen("\\Windows\\filename.dat","w"))==NULL)
{
MessageBox(L"File IO Error",L"Error");//error when no file found
}
fprintf(fp,"%s",Testing1);
fclose(fp);
//Read File
if((fp=fopen("\\Windows\\filename.dat","r"))=NULL)
{
MessageBox(L"File IO Error",L"Error");//error when no file found
}
fscanf(fp,"%s",Testing2);
fclose(fp);
//MessageBox(Testing2);
SetDlgItemText(IDC_TESTING,Testing2);