我有这些十六进制数:
0xAF2B,我必须计算小和大端。
我得到了这样的记忆:a;一个+ 1;一个+ 2;一个+ 3。
你能说出这是否正确吗?
0xAF2B
小端是正确的。但是大端是不正确的。
您的数字似乎有4个字节,在4个字节上,您的数字是0x00.00.AF.2B
因此,在大端计算机上,内存中的字节排列将是
a=0 MSB (big) comes first a+1=0 a+2=AF a+3=2B LSB last