哈德网站建设,网站建设 职责,求个没封的w站2021软件,网页游戏排行榜图标如果想在a.c中定义一个可以在b.c中可以使用的结构体变量#xff0c;则可以参照一下方法#xff1a;
首先在a.h中定义结构体和声明结构体变量#xff0c;如#xff1a;
typedef struct struct_a
{
//结构体内容
}
struct_a;extern struct_a aaa;
然后在a.c中定义结构体变…如果想在a.c中定义一个可以在b.c中可以使用的结构体变量则可以参照一下方法
首先在a.h中定义结构体和声明结构体变量如
typedef struct struct_a
{
//结构体内容
}
struct_a;extern struct_a aaa;
然后在a.c中定义结构体变量如下
#include a.hstruct_a aaa;
这样只要在b.c中#include a.h就可以在b文件中调用和使用结构体变量aaa了