码迷,mamicode.com
首页 > 编程语言 > 详细

C语言struct结构体的几种定义方式

时间:2020-05-02 10:12:21      阅读:77      评论:0      收藏:0      [点我收藏+]

标签:方式   变量   str   结构体类型   结构体   成员   struct   语言   结构   

struct属于结构体类型,有如下几种定义:

1struct

{

//成员名

}变量名;

2.sturct 类型名

{

/成员名

};

3.typedef是定义别名

typedef struct

{

//成员

}别名;

4.typedef struct 结构体类型名

{

//成员

}别名;

5. struct 类型名

{

}变量名;

6.typedef struct 结构体类型名

{

//成员

};此时无结构体别名。

C语言struct结构体的几种定义方式

标签:方式   变量   str   结构体类型   结构体   成员   struct   语言   结构   

原文地址:https://www.cnblogs.com/pquan/p/12816762.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!