我在一个a.h中定义了
static int HeroNum = 0; //人数
struct Hero
{
CString name;
int score;
};
static Hero heroman[3];并在其a.cpp进行了数据修改现在要在b.cpp中用heroman[3]和HeroNum,怎么办?
static int HeroNum = 0; //人数
struct Hero
{
CString name;
int score;
};
static Hero heroman[3];并在其a.cpp进行了数据修改现在要在b.cpp中用heroman[3]和HeroNum,怎么办?
a.h
extern int HeroNum ; //人数
struct Hero
{
CString name;
int score;
};
extern Hero heroman[3];