C++ Tutorial/Pointer/pointer to pointer
Pointer to a pointer
<source lang="cpp">#include <iostream> using namespace std;
int main() {
int x, *p, **q; x = 10; p = &x; q = &p; cout << **q; // prints the value of x return 0;
}</source>
10
<source lang="cpp">#include <iostream> using namespace std;
int main() {
int x, *p, **q; x = 10; p = &x; q = &p; cout << **q; // prints the value of x return 0;
}</source>
10