错误在哪里list-> qtag-> label = x;虽然试图把价值标签?C - 结构通过值 - 分段错误
struct quad{
int label;
char op[30];
char x[30];
char y[30];
char z[30];
struct quad *next;
};
struct tag{
struct quad *qtag;
struct tag *next2;
};
struct tag *makelist(int x){
struct tag *list;
list=(struct tag*)malloc(sizeof(struct tag));
list->qtag->label=x;
printf("!\n");
return list;
};
你在哪里为'*(list-> qtag)'分配内存? –
非常感谢!完全忘了! :D – user3601268
..如果你不想使用调试器,你很快就会发现它。 –