【发布时间】:2012-03-07 17:37:41
【问题描述】:
我已经阅读了大约 5 个关于同一个错误的不同问题,但我仍然找不到我的代码有什么问题。
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;
谢谢!
【问题讨论】:
-
@GregBrown:他正在取消引用指向不完整类型错误的指针。
标签: c compiler-errors