I am tasked with writitng a program that populates a data file based on the contents of structures defined in a library. Below are the structures.
I cannot change these structures to typedefs since they are in a library.Code:struct simrad_struct { int num_records; ... struct simrad_record_struct * recs; } struct simrad_record_struct { long id; .... long office_num }
My program has a function which takes in a populated simrad struct:
what I need to do is access the value of office_num, in the nested struct.Code:int (char * sim) { struct simrad_struct * sim_pop; sim2_pop = (struct simrad_struct *) sim; ..... return 0; }
gives the error "dereferencing pointer to incomplete type".Code:long office = sim2_pop->recs->office_num;
Does anyone know how I can access this value?
note that the following code works.
Code:int num = sim2_pop->num_records;



LinkBack URL
About LinkBacks



