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
Post a Comment