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

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -