指针pt的值(pt,pt,*pt)
代码:
#pragma warning(disable:4996)#include <stdio.h>
#include <stdlib.h>
#include <math.h>int main()
{int n=50;const int* pt = &n;n++;int sage = 80;printf("指针pt的值(pt):%20p\n",pt);printf("n的地址(&n): %20X\n", &n);printf("n的值: %20d\n", n);printf("*pt的值: %20d\n", *pt);printf("pt的地址(&pt):%20p\n", &pt);return 0;
}
结果:
指针pt的值(pt,pt,*pt)
代码:
#pragma warning(disable:4996)#include <stdio.h>
#include <stdlib.h>
#include <math.h>int main()
{int n=50;const int* pt = &n;n++;int sage = 80;printf("指针pt的值(pt):%20p\n",pt);printf("n的地址(&n): %20X\n", &n);printf("n的值: %20d\n", n);printf("*pt的值: %20d\n", *pt);printf("pt的地址(&pt):%20p\n", &pt);return 0;
}
结果: