J
Joseph
Hi, all
I have a sample code like the following detailed:
//-----------------
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,1428,1,fp1);
fclose(fp1);
// Step 3:the following code is to test the GetLength function!
int i;
i = ss.GetLength();
}
//-----------------------------
My question is : Why the value of i is 0, not the exact string
length? Could anybody tell me the root cause?
Thanks in advance!
Joseph
I have a sample code like the following detailed:
//-----------------
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,1428,1,fp1);
fclose(fp1);
// Step 3:the following code is to test the GetLength function!
int i;
i = ss.GetLength();
}
//-----------------------------
My question is : Why the value of i is 0, not the exact string
length? Could anybody tell me the root cause?
Thanks in advance!
Joseph