#include <stdio.h>
//typedef的作用:起别名
typedef struct student {
int num;
char name[20];
char sex;
}stu, * pstu; //定义结构体别名,结构体指针别名
typedef int INTEGER;
int main() {
stu s = { 1001,"lxl",'M' };
pstu p;//stu* p1,p1也是结构体指针
INTEGER i = 10;
p = &s;
printf("i=%d,p->num=%d\n", i, p->num);
system("pause");
}
typedef的作用:起别名
最新推荐文章于 2024-08-25 22:20:29 发布