J
Joseph
Hi, I have a question for CString. My C++ code is detailed as below,
FILE *fp1;
fp1=fopen("F:\\aa.dat","rb");
if(!feof(fp1))
{
// Step 1 :the following code is to read binary data from an
existing file
CString ss;
fread(ss.GetBuffer(1428),1428,1,fp1);
// Step 2: the following code is to test if the read action is
successful
fclose(fp1);
fp1 = fopen("F:\\bb.dat","wb+");
fwrite(ss.GetBuffer(),1428,1,fp1);
fclose(fp1);
// Step 3:the following code is to test the GetLength function!
int i;
i = ss.GetLength();
}
I find step 1 & 2 are all successful, but when I monitor the i value after
setp 3, I found the value is 0, could any body tell me why?
Thanks in advance!
Joseph
FILE *fp1;
fp1=fopen("F:\\aa.dat","rb");
if(!feof(fp1))
{
// Step 1 :the following code is to read binary data from an
existing file
CString ss;
fread(ss.GetBuffer(1428),1428,1,fp1);
// Step 2: the following code is to test if the read action is
successful
fclose(fp1);
fp1 = fopen("F:\\bb.dat","wb+");
fwrite(ss.GetBuffer(),1428,1,fp1);
fclose(fp1);
// Step 3:the following code is to test the GetLength function!
int i;
i = ss.GetLength();
}
I find step 1 & 2 are all successful, but when I monitor the i value after
setp 3, I found the value is 0, could any body tell me why?
Thanks in advance!
Joseph