typedef 用户自定义的数据类型取一个新的名字

#include <stdio.h>

//用户自定义的数据类型取一个新的名字
typedef int JJ; //为 int 再重新多取一个名字,JJ 等价于 int 

//定义一个结构体 

struct Student
{
    int sid;
    char name[200];
    char sex;
};


 int main(void)
 {
 //    struct Student st;
 //    struct Student * ps = &st;
     
     int i = 10;//等价于 JJ i = 10;
     JJ A = 100;
    printf("%d\n",A);
     
     return 0;
 }
 
 //运行结果是  
 
// 100
//
//--------------------------------
//Process exited after 0.00711 seconds with return value 0
//请按任意键继续. . .

 

posted @ 2018-02-04 18:08  马鞍山  阅读(239)  评论(0编辑  收藏  举报