由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - How to define a data type of 1 bit size?
相关主题
C++中size_type怎么处理?如何 define/initialize static data member of a class templ
C++小问题两个面世题
[合集] static const代替define的performance tradeoff在哪里?A question about class size
怎么把string变为一个variable的名字 ?C++ Q 108: swap
我的matlab 抽风了。。。。python question, easy one
这两个地方是否需要typename?老魏老姜老霸,我出银子给你们开机器
How to get all defined data types out of a elf object file?java里run curl system command的问题
What're the three types of memory allocated for C++ variables?register variable
相关话题的讨论汇总
话题: define话题: bit话题: type话题: data话题: variable
进入Programming版参与讨论
1 (共1页)
e******n
发帖数: 86
1
For a binary variable (it can contain either a 0 or a 1).
Is there any way I can define a data type that uses only 1 bit.
Currently, I defined it as byte variable
//xiexie
f********r
发帖数: 50
2
consider bit field in structure instead

【在 e******n 的大作中提到】
: For a binary variable (it can contain either a 0 or a 1).
: Is there any way I can define a data type that uses only 1 bit.
: Currently, I defined it as byte variable
: //xiexie

t****n
发帖数: 15
3
If c/c++, use bit field. Or use vector if you need to define an array.

【在 f********r 的大作中提到】
: consider bit field in structure instead
1 (共1页)
进入Programming版参与讨论
相关主题
register variable我的matlab 抽风了。。。。
Can we define pure virtual function? (转载)这两个地方是否需要typename?
lambda的一个疑问How to get all defined data types out of a elf object file?
sql 数据是存在哪里 (转载)What're the three types of memory allocated for C++ variables?
C++中size_type怎么处理?如何 define/initialize static data member of a class templ
C++小问题两个面世题
[合集] static const代替define的performance tradeoff在哪里?A question about class size
怎么把string变为一个variable的名字 ?C++ Q 108: swap
相关话题的讨论汇总
话题: define话题: bit话题: type话题: data话题: variable