我正在练习C语言。我有 Win 10 系统,我正在练习它,我总是得到 2 的倍数的地址。知道,我正在 Macbook Pro M3 上练习,我得到 9 位地址。
另外,这是代码和结果:
#include <stdio.h>
int main(void)
{
int m = 10, n, o, *z;
z = &m;
printf("z stores the address of m = %p\n", z);
printf("*z stores the value of m = %d\n", *z);
printf("&m is the address of m = %p\n", &m);
printf("&n stores the address of n = %p\n", &n);
printf("&o stores the address of o = %p\n", &o);
printf("&z stores the address of z = %p\n", &z);
return 0;
}
z stores the address of m = 0x16fa13228
*z stores the value of m = 10
&m is the address of m = 0x16fa13228
&n stores the address of n = 0x16fa13224
&o stores the address of o = 0x16fa13220
&z stores the address of z = 0x16fa13218
我对此进行了研究,但没有得到好的答案。这是我发现的:
我希望看到多位数字的地址。
我有 Win 10 系统,我正在练习它,我总是得到 是 2 的倍数的地址
知道,我正在 Macbook Pro M3 上练习,我得到了 9 位地址。
它不取决于数字的位数,只取决于该数字的值。
示例:
0x16fa13228
是十进制的 6167802408
。这个数字可以被2整除。