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

分类: Uncategorized , C/C++

2014-09-20

|

1359

|

评论:0

分享:

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;

 

 



转载请注明来源

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

链接:/article/8

作者:gojuukaze

标签: typedef
本文共 0 个回复

发表评论 (对文章评论)

captcha