- 论坛徽章:
- 0
|
int saveIndex(struct hashTable * ht)
{
FILE * fpSI;
fpSI = fopen("/usr/local/MetaData/hashIndex.in","wb");
if(NULL==fpSI)
{
printf("open /usr/local/MetaData/hashIndex.in failed");
exit(-1);
}
//struct hashTable * list;
//list = ht;
for(; (ht->next)!=NULL;ht=ht->next) <------ dereferencing pointer to incomplete type
{
fwrite(ht,sizeof(struct hashTable),1,fpSI);
}
fwrite(ht,sizeof(struct hashTable),1,fpSI);
fclose(fpSI);
return 0;
}
其中,struct hashTable在hashTable.h中声明,在hashTable.c中定义,编译是已经把include"hashTable.h"了,但是编译是就出现dereferencing pointer to incomplete type
但是如果把struct hashTable在hashTable.h中定义,编译就没有问题
为什么会这样呢? |
|