当前位置:网站首页>Learning bit segment (1)
Learning bit segment (1)
2022-06-24 22:36:00 【Code loving students】
1. What is a bit segment ?
The declaration and structure of a bit segment are similar , There are two differences :
1. The member of the segment must be int、unsigned int or signed int .
2. There is a colon and an Arabic numeral after the member name of the bit field .
for example :
struct A
{ int a: 2;
int b: 5;
int c: 10;
int d: 30;
};
A It's a bit segment type .
that A What is the size of ?
If there is no number after the colon, we can get the result by calculating the structure 16, What is this size ?

We can find that there are only eight bytes , Then we can know that the units of this number are bit.
边栏推荐
- ThreadLocal memory leak
- Technology inventory: Technology Evolution and Future Trend Outlook of cloud native Middleware
- A girl has been making hardware for ten years. 。。
- Introduction, installation and use of postman tool
- 干货丨产品的可行性分析要从哪几个方面入手?
- Description of software version selection of kt6368a Bluetooth dual-mode transparent chip
- 使用Aggregated APIServer扩展你的kubernetes API
- 零代码即可将数据可视化应用到企业管理中
- Basic principles of spanning tree protocol
- 【软件工程】期末重点
猜你喜欢

The ktp900f mobile download program of the fail safe mobile panel prompts that the download cannot be performed, and the target device is running or not in the transmission mode

NIO、BIO、AIO

How to automatically remove all . orig files in Mercurial working tree?

Creating files, recursively creating directories

Use of selector for NiO multiplexing

Introduction, installation and use of postman tool

软件设计的七大原则

干货丨产品的可行性分析要从哪几个方面入手?

FANUC机器人_KAREL编程入门学习(1)

Heavyweight! Fada is listed as a "specialized and new" enterprise
随机推荐
Basic principles of spanning tree protocol
网上立案流程
Uncover the secret of station B. is it true that programmers wear women's clothes and knock code more efficiently?
第二批入围企业公示!年度TOP100智能网联供应商评选
NIO、BIO、AIO
New features of go1.18: efficient replication, new clone API for strings and bytes standard library
Disk structure
电力系统| IEEE论文投稿流程
无心剑汉英双语诗003. 《书海》
Zero code can apply data visualization to enterprise management
YGG recent game partners list
Code farmers should also understand the IPv4 subnet division of point networks
Redis-跳表
How to grab the mobile phone bag for analysis? Fiddler artifact may help you!
Firewall working principle and detailed conversation table
Rip protocol of dynamic routing protocol
Description of software version selection of kt6368a Bluetooth dual-mode transparent chip
First order model realizes photo moving (with tool code) | machine learning
NiO, bio, AIO
Description of transparent transmission function before master and slave of kt6368a Bluetooth chip, 2.4G frequency hopping automatic connection