if i have a file struct HEADER and a file struct BODY which contains the struct HEADER :
typedef struct HEAD
{
int somenumber1;
int somenumber2;
BOOL somebool;
long somenumber3;
} HEADER;
typedef struct BODY
{
HEADER head
int bodynumber1;
int bodynumber2;
}BODYTYPE
say i read a file with this structure like this:
FILE *filename1;
BODYTYPE test;
fread(&test,sizeof(test),1,filename1);
this works fine but what if i want to skip the HEADER and just read the BODY?
iknow i have to find the size of HEAD and then use lseek to move the file pointer then use fread but i'm not quite sure how to code this?
help pls .
typedef struct HEAD
{
int somenumber1;
int somenumber2;
BOOL somebool;
long somenumber3;
} HEADER;
typedef struct BODY
{
HEADER head
int bodynumber1;
int bodynumber2;
}BODYTYPE
say i read a file with this structure like this:
FILE *filename1;
BODYTYPE test;
fread(&test,sizeof(test),1,filename1);
this works fine but what if i want to skip the HEADER and just read the BODY?
iknow i have to find the size of HEAD and then use lseek to move the file pointer then use fread but i'm not quite sure how to code this?
help pls .