typedef的用法

Posted zklgy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typedef的用法相关的知识,希望对你有一定的参考价值。

# include <stdio.h>

typedef struct Student  //给数据类型重新定义个名字为 ST
{
    int sid ;
    char name;
}ST;

typedef struct Student  //给数据类型重新定义个名字为 ST
{
    int sid ;
    char name;
}* ST;        //等价于 struct Student * st

typedef struct Student  //给数据类型重新定义个名字为 ST
{
    int sid ;
    char name;
}* ST ,SU;        //ST 等价于 struct Student * st, SU 等价于struct Student st

int main(void)
{
    ST st; //等价于 struct Student st
}

 

以上是关于typedef的用法的主要内容,如果未能解决你的问题,请参考以下文章