用vs2013,static显示不允许指针指向不完整的类类型
void addBook(struct Book **library){
struct Book *book,*temp;
static struct Boook *endNode ;
book = (struct Book *)malloc(sizeof(struct Book));
if (book == NULL)
{
printf("内存分配失败!");
exit(1);
}
getInput(book);
if (*library != NULL)
{
/*temp = *library;
while (temp->next != NULL)
{
temp = temp->next;
}
temp->next = book;
book->next = NULL;*/
endNode->next = book;
book->next = NULL;
//*library = book;
//book->next = temp;
}
else
{
*library = book;
book->next = NULL;
}
endNode = book;
}
这是我看飞哥的书里的案例写的,并且压缩包里的源码也是这样的;
但是 在vs2013里,红色底地方 报错 说是不允许指针指向不完整的类类型,怎么解决呀;我去网上查,都是说缺少,include;但是我的有啊
就是声明static struct Boook *endNode 这一条,还有这一条endNode->next = book;vs2013中报错 已经解决 。。
页:
[1]