网站首页  英汉词典

请输入您要查询的英文单词:

 

单词 Bitfields
释义

Bitfields

中文百科

位段 Bit field

(重定向自Bitfields)

位段(Bit field)为一种数据结构,可以把数据以比特的形式紧凑的储存,并允许进程员对此结构的比特进行操作。这种数据结构的一个好处是它可以使数据单元节省储存空间,当进程需要成千上万个数据单元时,这种方法就显得尤为重要。第二个好处是位段可以很方便的访问一个整数值的部分内容从而可以简化进程源代码。而这种数据结构的缺点在于,位段实现依赖于具体的机器和系统,在不同的平台可能有不同的结果,这导致了位段在本质上是不可移植的。

在C语言中,位段的声明和结构(struct)类似,但它的成员是一个或多个比特的字段,这些不同长度的字段实际储存在一个或多个整型变量中。在声明时,位段成员必须是int、signed int或unsigned int类型,且在成员名的后面是一个冒号和一个整数,整数规定了成员所占用的比特数。以下进程则展示了一个位段的声明:

英语百科

Bit field 位段

(重定向自Bitfields)

A bit field is a term used in computer programming to store multiple, logical, neighboring bits, where each of the sets of bits, and single bits can be addressed. A bit field is most commonly used to represent integral types of known, fixed bit-width. A well-known usage of bit-fields is to represent a set of bits or series of bits, known as flags. For example, the first bit in a bit field can be used to determine the state of a particular attribute associated with the bit field.

随便看

 

英汉网英语在线翻译词典收录了3779314条英语词汇在线翻译词条,基本涵盖了全部常用英语词汇的中英文双语翻译及用法,是英语学习的有利工具。

 

Copyright © 2004-2024 encnc.com All Rights Reserved
更新时间:2025/6/19 4:32:56