Reading Binary file in C

Posted by darkie15 on Stack Overflow See other posts from Stack Overflow or by darkie15
Published on 2010-04-02T03:11:30Z Indexed on 2010/04/02 3:13 UTC
Read the original article Hit count: 446

Filed under:
|
|
|

Hi All,

I am having following issue with reading binary file in C.

I have read the first 8 bytes of a binary file. Now I need to start reading from the 9th byte. Following is the code:

fseek(inputFile, 2*sizeof(int), SEEK_SET);

However, when I print the contents of the array where I store the retrieved values, it still shows me the first 8 bytes which is not what I need.

Can anyone please help me out with this?

Regards, darkie

© Stack Overflow or respective owner

Related posts about file-io

Related posts about c