我已经阅读了关于同一个错误的5个不同的问题,但我仍然无法找到与我的代码有什么问题。C - 取消引用指向不完整类型的指针
的main.c
int main(int argc, char** argv) {
//graph_t * g = graph_create(128); //I commented this line out to make sure graph_create was not causing this.
graph_t * g;
g->cap; //This line gives that error.
return 1;
}
.C
struct graph {
int cap;
int size;
};
.H
typedef struct graph graph_t;
谢谢!
请告诉我的错误? – 2012-03-07 17:42:40
@GregBrown:他正在取消引用指向不完整类型错误的指针。 – 2012-03-07 17:43:37