Due to server problems the website is temporarily offline! Visit http://www.smorgasbordet.com/pellesc/ to download Pelles C.
int cnt;WORD ChunkID;FILE* FP1; FP1=fopen(FileName,"rb");GET(FP1,&ChunkID,sizeof(WORD));cnt =ftell(FP1); // cnt = 2 Herefseek(FP1,10,SEEK_CUR );cnt =ftell(FP1); // cnt = 0x20A Herefclose(FP1);
btw, GET is a BCX macro:#define GET(A,B,C)fread(B,1,C,A)Also, ths person that wrote the original program stated that the problem started after 2.9 beta 5 if that is any help?Mike H.
#define GET(A,B,C)fread(B,1,C,A)int main(void){ char FileName[] = "main.c"; int cnt; WORD ChunkID; FILE * FP1; FP1 = fopen(FileName,"rb"); GET(FP1,&ChunkID,sizeof(WORD)); cnt = ftell(FP1); // cnt = 2 Here printf("%d\n", cnt); fseek(FP1,10,SEEK_CUR ); cnt = ftell(FP1); // cnt = 12 Here printf("%d\n", cnt); fclose(FP1); return 0;}
Hi John,Are you using the latest version ?Are you linking with the MS runtime?, it will work correctly. Using the PellesC runtime I still 2 and 522Thanks,Mike H.