我的编程学习日志(7)--typedef的扩展

typedef最常见的用法就是:

typedef int I;

typedef struct student stu;

typedef struct student* pstu;

 

 

不过我们有时也会见到这样的用法

typedef struct student

{

int a;

} stu;

其实这个和typedef struct student stu是一样的。

 

typedef struct student

{

int a;

}* pstu;

这和和typedef struct student* pstu 一样。

 

另外,有时也会看到这种情况:

typedef struct student

{

int a;

}* pstu,stu;

这个就相当于:

typedef struct student* pstu;

typedef struct student stu;

 

 

posted @ 2014-09-20 13:11  五十风  阅读(141)  评论(0编辑  收藏  举报