C--typedef 给数据类型起新名字

#include <stdio.h>
//给结构体起个新名字stu 
typedef struct student {
        char name[50];
        int age;
        int achievement;
    } stu;
    //student 可以不要
    //新名字的好处,使用时简洁 

int main ()
{
   
    typedef int Length;//给数据类型起个新名字
    //给int起个新名字 Length
    stu d;
    
           
   
   return(0);
}

猜你喜欢

转载自www.cnblogs.com/liming19680104/p/13374912.html