C++ Tutorial/Pointer/pointer to pointer

Материал из C\C++ эксперт
Перейти к: навигация, поиск

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