|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include <iostream>
using namespace std;
int main(void)
{
int a = 1;
int b = 1;
int *pa = &a;
int *pb = pa;
int *pc = &a;
int *pd = &b;
printf("Address of pa is %p, and address of what pa points is %p\n", pa, &(*pa));
printf("Address of pb is %p, and address of what pb points is %p\n", pb, &(*pb));
printf("Address of pc is %p, and address of what pc points is %p\n", pc, &(*pc));
printf("Address of pd is %p, and address of what pd points is %p\n", pd, &(*pd));
return 0;
}
输出:
Address of pa: 0x7fff8bada600, address of what pa points: 0x7fff8bada600
Address of pb: 0x7fff8bada600, address of what pb points: 0x7fff8bada600
Address of pc: 0x7fff8bada600, address of what pc points: 0x7fff8bada600
Address of pd: 0x7fff8bada604, address of what pd points: 0x7fff8bada604 |
|