Why is a boolean 1 byte and not 1 bit of size?(为什么布尔值是 1 字节而不是 1 位大小?)
问题描述
在 C++ 中,
- 为什么布尔值是 1 字节而不是 1 位大小?
- 为什么没有像 4 位或 2 位整数这样的类型?
在为 CPU 编写模拟器时,我错过了上述内容
I'm missing out the above things when writing an emulator for a CPU
推荐答案
因为 CPU 无法处理小于字节的任何内容.
Because the CPU can't address anything smaller than a byte.
这篇关于为什么布尔值是 1 字节而不是 1 位大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!