通过以下代码快速理解指针:
#include <iostream>
using namespace std;
int main()
{
int a = 9, b = 29;
int *p_one;
p_one = &a;
int *p_tow = &b;
cout << "a的值: " << a << endl;
cout << "a的地址: " << &a << endl;
cout << "p_one指向的值: " << *p_one << endl;
cout << "p_one的值: " << p_one << endl;
cout << "p_one的地址: " << &p_one << endl;
cout << "b的值: " << b << endl;
cout << "b的地址: " << &b << endl;
cout << "p_tow指向的值: " << *p_tow << endl;
cout << "p_tow的值: " << p_tow << endl;
cout << "p_tow的地址: " << &p_tow << endl;
system("pause");
return 0;
}