C语言 typedef struct _STUDENT {}STUDENT,*PSTUDENT;

 1 #include <stdio.h>
 2 #include <stdlib.h>
 3 #include <string.h>
 4 
 5 //给stuct _STUDENT 起一个别名 为 STUDENT,*PSTUDENT
 6 typedef struct _STUDENT 
 7 {
 8     char cName;
 9     int nAge;
10     
11 }STUDENT,*PSTUDENT;
12 //强制理解  本身student为*类型  struct _student *   在使用student 的时候
13 
14 
15 int main() 
16 {
17     //原始方法
18     //声明一个结构体
19     struct _STUDENT student1;
20     //定义结构体指针
21     struct _STUDENT* student2;
22 
23     //起别名之后
24     STUDENT student4;    //等价于 student _STUDENT
25     PSTUDENT student5;    //等价于 student _STUDENT *
26 
27     
28 
29     
30 }

 

posted @ 2020-02-24 18:15  冫恋丶  阅读(647)  评论(0编辑  收藏  举报