当前位置:网站首页>共用(联合)体
共用(联合)体
2022-07-17 05:08:00 【学会放下ta】
共用体(联合)
与结构体区别就是共用体地址是一样的,同一时间只能用一个成员,共用体的占空间大小大于等于成员中最大的数据结构。初始化也只能初始化一个。
union 名称{
成员1;
成员2;
成员3;
...
}
枚举类型
声明
enum day{
monday,tuesday,wednesday,thursday,friday,saturday,sunday};//这种是枚举常量
enum day today;//这个是枚举变量
today = monday;//给变量赋值
枚举常量对应的数据类型是int默认从0开始,依次加一,可以自定义,例如把Monday赋值为10,后面依次加一,若把Wednesday赋值为10,则前两个是0,1,后面是10,依次加一。
边栏推荐
- 2.6.2 memory leakage
- H5 page uses JS to generate QR code
- Redis source code analysis 2 iterator
- Network command: network card information, netstat, ARP
- Redis source code analysis 3 implementation of discontinuous traversal
- mysql - 索引
- Multifunctional (Implementation) encapsulation function
- Data visualization
- Swagger配置与使用
- Round robin schedule problem
猜你喜欢

循环赛制日程表问题

mysql的事务

【全网首发】JVM性能问题的自动分析

Cesium BIND Mouse Events and remove Mouse Events

Addition and removal of cesium geojson data

字幕文件与视频文件对不上的处理方式

Performance bottleneck finding - Flame graph analysis

ArcMap creates a constant grid and tessellates it into a new grid

Shell script configures root to login to other hosts without secret

Parent components plus scoped sometimes affect child components
随机推荐
MapBox 加载本地离线地形
mysql - 索引
Easypoi excel simple export
Use of log4j
User mode protocol stack - UDP implementation based on netmap
ambari 2.7.5集成安装hue 4.6
Buuctf miscellaneous - QR code
Easypoi之excel多sheet导入
Common methods of goframe error handling & use of error codes
STL container - basic operation of vector
What is the employment prospect of software testing? There is a large demand for talents and strong job stability
线程池如何监控,才能帮助开发者快速定位线上错误?
Wechat applet learning notes
Rk356x u-boot Institute (command section) 3.4 usage of MEM memory related commands
How to deal with the mismatch between subtitle files and video files
Easypoi之excel模板导出
单臂路由配置
UML(用例图,类图,对象图,包图)
Redis source code analysis 2 iterator
Markdown notes and related shortcut keys of typora