我已经阅读了有关同一错误的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;
}
Run Code Online (Sandbox Code Playgroud)
。C
struct graph {
int cap;
int size;
};
Run Code Online (Sandbox Code Playgroud)
。H
typedef struct graph graph_t;
Run Code Online (Sandbox Code Playgroud)
谢谢!