理解二级指针的好例子
/* Name: Copyright: Author: 流照君 Date: 2019/9/22 22:29:36 Description: */ #include <iostream> #include<string> #include <algorithm> #include <vector> #define inf 0x3f3f3f3f using namespace std; typedef long long ll; void move(int **p,int a[]) { cout<<p<<endl; *p=&a[1]; cout<<*p<<endl; } int main(int argc, char** argv) { //freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout); int a[]={1,2,3,4,5}; int *p=&a[0]; //p=&a[0]; cout<<p<<" "<<&a[0]<<endl; move(&p,a); cout<<*p<<endl; return 0; }
如果你够坚强够勇敢,你就能驾驭他们