2011-05-22 118 views
1

我有這個麻煩... 我有這樣的標題:的Structs到另一頭一個struct

#ifndef PESSOA_H 
#define PESSOA_H 

typedef struct pa{ 
    int idade; 
    int atend; 
}pessoa; 


void inicPessoa(pessoa *ps, int id); 

#endif 

,並在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 

但編譯器說filaC.h的實際信息有一個不完整的類型。

elem_t info;更改爲struct elem_t into;沒有效果。

回答

4

您沒有類型struct pessoa。你有struct pa,你有pessoa(typedef)。

所以,你需要改變這一點:進入一個

typedef struct pessoa elem_t; 

typedef struct pa elem_t; 
typedef pessoa elem_t; 
相關問題