【发布时间】:2020-03-19 12:26:18
【问题描述】:
我知道字节和位以及计算机如何使用以 2 为底的(二进制)数字系统。
然而,我很难理解 32 位(4 字节)整数如何在字节数组中表示。
int exampleInt = 270;
byte[] intBytes = BitConverter.GetBytes(exampleInt);
// intBytes = [14, 1, 0, 0]
14 和 1 代表什么?我知道一个字节可以在 0 到 255 之间。
非常感谢这些数字和 4 个字节的细分。
【问题讨论】: