我学了C语言,我有一些问题。
如果找到内存区域开头的地址的最好方法是使用指针?
例如,在几个步骤
a = 1;int *pointer_a;的指针pointer_a = a;printf("Adress variable a= %p", &pointer_a);我做得对吗?
发布于 2017-06-11 19:05:37
pointer_a应该保存变量a的内存地址,指针就是这样做的。就指针而言,&是address of operator。
pointer_a = &a;然后你就可以。printf("Address variable a = %p", pointer_a);
您仍然可以直接printf("Address variable a = %p", &a);
https://stackoverflow.com/questions/44487473
复制相似问题