typedef struct

来源:互联网 发布:医疗大数据应用案例 编辑:程序博客网 时间:2024/05/15 23:46

在看到彪哥C课件的文件输入输出时看到这页

 


于是去网上搜索了一些答案,整理如下:

typedef声明新的类型来代替已有的类型的名字。如:typedef int INTEGER;下面两行等价int i;INTEGER i;可以声明结构体类型:typedef struct {int age;int score;}STUDENT;定义变量:只能写成 STUDENT stu;如果写成typedef struct student{int age;int score;}STUDENT;下面三行等价:STUDENT stu;struct student stu;student stu;
这就意味着经常看到的File *p,所定义的每个指针都含有上述图片所呈现的变量~

0 0