Hi,
I am doing the following to read in a file however it does'nt seem to be
reading in the correct size its like a few hundred bytes short?
level = fopen("c:\\MALEV01.AIM","r");
fseek(level,0,SEEK_END);
level_size=ftell(level);
fseek(level,0,SEEK_SET);
levelBuffer = (char*)malloc(level_size);
fread((char*)levelBuffer,1,level_size,level);
What am i doing wrong
Thanks
Ady.
William DePalo [MVP VC++ ] - 18 Sep 2003 15:28 GMT
> I am doing the following to read in a file however it does'nt seem to be
> reading in the correct size its like a few hundred bytes short?
>
> level = fopen("c:\\MALEV01.AIM","r");
Try opening the file in binary mode: "rb"
Regards,
Will