当前位置:网站首页>共用(联合)体
共用(联合)体
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,依次加一。
边栏推荐
- Round robin schedule problem
- [ES6] quickly print user information to the page
- [AI] action recognition using simple neural network -- Based on coco key points
- 线程池如何监控,才能帮助开发者快速定位线上错误?
- 父组件加scoped有时也会影响子组件
- Distributed registry etcd
- Solve the problem of inconsistent prediction effect between text detection training model and information model based on paddleocr
- Cesium bind mouse events and remove mouse events
- UML (use case diagram, class diagram, object diagram, package diagram)
- ambari2.7.5集成es6.4.2
猜你喜欢

ArcMap 创建常量栅格并镶嵌至新栅格

云服务器部署WEB项目

Online software testing training institutions lemon class and itest AI platform achieves strategic cooperation

Router loopback port experiment

CityEngine 三维管道建模教程

Performance bottleneck finding - Flame graph analysis

Mapbox loads local offline terrain

Talk about 12 business scenarios of concurrent programming

【全网首发】一个月后,我们又从 MySQL 双主切换成了主-从

Teach you to reproduce log4j2 nuclear weapon level vulnerability hand in hand
随机推荐
ECS deployment web project
Three methods for cesium to obtain the longitude and latitude at the mouse click
新手学习渗透测试的入门指南
Excel导入长数据末尾变000
ambari2.7.5集成es6.4.2
【全网首发】主线程异常会导致 JVM 退出?
柠檬班软件测试培训可靠吗 这个从培训班逆袭成功的案例告诉你
网络命令:网卡信息,netstat,arp
Round robin schedule problem
B域,M域,O域具体是指什么
MySQL - index
Easypoi excel simple export
Excel calculates the remaining days of the month
分布式存储-fastdfs
Distributed storage fastdfs
[AI] action recognition using simple neural network -- Based on coco key points
BUUCTF web WarmUp
Redis source code analysis 3 implementation of discontinuous traversal
STL container - basic operation of vector
2020-11-10