#include<string.h>
#include<stdio.h>
#include<conio.h>
struct student //用struct自定义数据类型,如int,char等
{
int ID;
char name[10];
float score;
}; //需要用分号结尾
typedef struct OK//typedef给数据类型起别名
{
int ATT;
int HP;
}ko; //ko是struct OK的别名
void yyhs(); //声明函数,尝试调用函数
int main()
{
yyhs();
struct student hhh = { 23001,"李四",23.1 };
hhh.ID = 23011;
//字符更改错误示范:
// hhh.name[7] = "张三"strcpy(hhh.name, "张三");
hhh.score = 22.0;
printf("%s\n", hhh.name);
struct OK dog = { 12,100 };
printf("%d\n", dog.HP);
ko pig = { 15,50 };
printf("%d\n", pig.ATT);
return 0;
}
void yyhs()
{
printf("你好cc");
}