Using fread on binary file into a struct in C -
infile .bin file , ai_fileheader struct 3 ints , keep getting error error: expected expression before ‘ai_fileheader’
fread(ai_fileheader, sizeof(ai_fileheader) ,1 , infile);
i've tried &. same error.
fread(&ai_fileheader, sizeof(ai_fileheader), 1, infile); typedef struct { int file_size; int section_table_offset; int section_count; } ai_fileheader;
solved
ai_fileheader head; fread(&head, sizeof(ai_fileheader), 1,infile);
Comments
Post a Comment