当前位置:网站首页>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.
边栏推荐
猜你喜欢

Tetris

Basic principles of spanning tree protocol

Idea global search replace shortcut key

Chapter 10 project stakeholder management

NIO、BIO、AIO

The profound meaning of unlimited ecological development in Poka -- Multidimensional Interpretation of parallel chain

Fanuc robot_ Introduction to Karel programming (1)

Future development of education industry of e-commerce Express

socket done

一个女孩子居然做了十年硬件。。。
随机推荐
2022-06-10 工作记录--JS-获取到某一日期N天后的日期
Chapter 10 project communication management
Docker 安装 MySQL 8.0,详细步骤
Virtual private network foundation
04A interrupt configuration
Principles of Ethernet port mirroring, link aggregation and VLAN Technology
理想L9,智能座舱新潮流
ansible基本配置
AQS源码分析
Relationnet++: a representation of fusion of multiple detection targets based on transformer | neurips 2020
使用Aggregated APIServer扩展你的kubernetes API
Zero code can apply data visualization to enterprise management
干货丨产品的可行性分析要从哪几个方面入手?
ThreadLocal memory leak
How to extract dates from web pages?
HTTP的缓存控制
系统测试主要步骤
Publicity of the second batch of shortlisted enterprises! Annual Top100 smart network supplier selection
NIO、BIO、AIO
In the era of industrial Internet, there is no Internet in the traditional sense