#include<iostream>
using namespace std;
int main()
{
int *pInt = NULL;
cout << "指针变量pInt地址是:" << &pInt << endl;
int pop = 1;
cout << "pop地址是:"<< &pop << endl;
cout << "pop值是:"<< pop << endl;
pInt = &pop;
cout << "pInt's value is:"<<pInt<<endl;
cout << "pInt's refer value is:"<< *pInt<<endl;
int arr_int[2] = { 1,2 };
pInt = arr_int;
cout << "Address of the first factor of arr_int[0] is: "<< pInt<<endl;
cout << "Address of the second factor of arr_int[1] is: "<<pInt + 1<<endl;
cout << "Value of the first factor of arr_int[0] is:"<<*pInt<<endl;
cout << "Value of the first factor of arr_int[1] is:"<< *pInt + 1<<endl;
}
指针测试
最新推荐文章于 2023-08-28 16:42:06 发布