typedef用法

来源:互联网 发布:苹果手机怎么信任软件 编辑:程序博客网 时间:2024/05/21 21:37
#include<stdio.h>//typedef 为数据类型重命名typedef struct Student {int age;int id;char name[20];}* PSTU , STU;//PSTU等价于struct Student*类型,STU等价于struct Student类型int main() {STU st;//相当于struct Student st;PSTU pst = &st;//相当于struct Student* pst;pst->id = 99;printf("%d", pst->id);return 0;}

0 0
原创粉丝点击