c - Structs from one header into a struct in another header -


i'm having trouble on this... have header:

#ifndef pessoa_h #define pessoa_h  typedef struct pa{     int idade;     int atend; }pessoa;   void inicpessoa(pessoa *ps, int id);  #endif 

and, in filac.h:

#ifndef filac_h #define filac_h  #include "pessoa.h"  typedef struct pessoa elem_t;  typedef struct no{   elem_t info;   struct no *prox, *ant; } no;  typedef no * fila; #endif 

but compiler says fiel info on filac.h has incomplete type.

changing elem_t info; struct elem_t into; had no effect.

you have no type called struct pessoa. have struct pa, , have pessoa (a typedef).

so need change this:

typedef struct pessoa elem_t; 

into 1 of:

typedef struct pa elem_t; typedef pessoa elem_t; 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -