我正在尝试使用草稿main()编译某些函数,当我尝试进行编译时,出现3个错误:分别指向不完整类型'struct InfoSession','struct TabNode','struct SiteNode'的指针第SessionPtr->FirstTab = TabPtr;
行
SessionNew函数中的TabPtr->PrevTab = NULL;
SitePtr->PrevSite = NULL;
。我已经搜索过,但是找不到任何可以帮助我的东西。
关于如何解决此错误的任何想法?
预先感谢。
typedef struct TabNode *TabNodePtr;
typedef struct SiteNode *SiteNodePtr;
typedef struct InfoSession *InfoSessionPtr;
typedef struct {
TabNodePtr FirstTab;
TabNodePtr LastTab;
TabNodePtr CurrTab;
TabNodePtr AuxTab;
char* OpeningAddress;
} InfoSession;
typedef struct {
TabNodePtr PrevTab, NextTab;
SiteNodePtr FirstSite;
SiteNodePtr CurrSite;
} TabNode;
typedef struct {
SiteNodePtr PrevSite, NextSite;
TabNodePtr UpTab;
char *Address;
} SiteNode;
InfoSessionPtr SessionNew(char *OpeningAddress){
InfoSessionPtr SessionPtr;
TabNodePtr TabPtr;
SiteNodePtr SitePtr;
SessionPtr = malloc(sizeof(InfoSession));
if (SessionPtr == NULL){
printf("Not enough space to allocate memory for InfoSession\n");
exit(0);
}
TabPtr = malloc(sizeof(TabNode));
if (TabPtr == NULL){
printf("Not enough space to allocate memory for first tab\n");
exit(0);
}
SitePtr = malloc(sizeof(SiteNode));
if (SitePtr == NULL){
printf("Not enough space to allocate memory for first site\n");
exit(0);
}
SessionPtr->FirstTab = TabPtr;
SessionPtr->LastTab = TabPtr;
SessionPtr->CurrTab = TabPtr;
SessionPtr->AuxTab = NULL;
TabPtr->PrevTab = NULL;
TabPtr->NextTab = NULL;
TabPtr->FirstSite = SitePtr;
TabPtr->CurrSite = SitePtr;
SitePtr->PrevSite = NULL;
SitePtr->NextSite = NULL;
SitePtr->UpTab = TabPtr;
SitePtr->Address = OpeningAddress;
return SessionPtr;
}