From: "姜华" <jh2012626@xxxxxxxxx>
在自定义的头文件中,有结构体, 5个.c文件中都包含这个头文件。 没有加条件编译为什么不出错, 加上反而不能编译通过?
是代码中的 #ifndef 么? 那不是这样加的。 自定义的头文件,为了避免里面东西的 重复定义,一般要养成习惯用 #ifndef ...#endif 包起来。
#include <stdio.h> //#ifndef typedef struct student { int num; int mathmid; int mathend; float average; } STU, *PSTU; //#endif
Learning, Just As Your Favourite Thing! Maillist, See http://www.juliantec.info/mlist/mail-lists.html JulBlog, See http://www.juliantec.info/julblog/summary.php JulWiki, See http://www.juliantec.info/wiki/ JulJob, see http://www.juliantec.info/juljob/