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.
Code:
struct simrad_struct
{
int num_records;
...
struct simrad_record_struct * recs;
}

struct simrad_record_struct
{
long id;
....
long office_num
}
I cannot change these structures to typedefs since they are in a library.

My program has a function which takes in a populated simrad struct:
Code:
int (char * sim)
{
struct simrad_struct * sim_pop;
sim2_pop = (struct simrad_struct *) sim;

.....
return 0;
}
what I need to do is access the value of office_num, in the nested struct.
Code:
long office =  sim2_pop->recs->office_num;
gives the error "dereferencing pointer to incomplete type".

Does anyone know how I can access this value?

note that the following code works.
Code:
int num = sim2_pop->num_records;