70,023
社区成员




Hero.h 文件为:
#ifndef HERO_H_INCLUDED
#define HERO_H_INCLUDED
typedef struct _myTime
{
int year;
int month;
int day;
}MyTime;
typedef struct _hero
{
char name[50];
char sex;
char job[20];
int life;
double speed;
char abillity[20];
MyTime pubTime;
}Hero;
#endif // HERO_H_INCLUDED
Hero.c文件为:
#include "Hero.h"
Hero heros[] = {
{"影流之猪姐",'m',"刺客",579,0.644,"位移",{2012,8,15}}
};
main.c文件为:
#include <stdio.h>
#include <stdlib.h>
#include "Hero.c"
extern Hero heros;
int main()
{
printf("%s\n",heros[0].name);
return 0;
}