int x=10;
int *p;
p=&x;
int **pp=&p;
cout<<**pp<<"\n"<<*p<<"\n"<<pp<<"\n"<<&p<<"\n";
Run Code Online (Sandbox Code Playgroud)
在上述情况下一切顺利,但是当我改变声明指针 p 的方式时:
int x=10;
int *p;
*p=x;
int **pp=&p;
cout<<**pp<<"\n"<<*p<<"\n"<<pp<<"\n"<<&p<<"\n";
Run Code Online (Sandbox Code Playgroud)
它没有给出任何输出。这是为什么?