+ 3

How it works?

int a=10; int *p1=&a; int **p2=&p1; cout<<**p2; Output=10

2nd Jan 2017, 4:58 AM
B Shardiya
1 Resposta
0
Hi! p1 is pointer to a=10, then p2 is pointer to p1. System firstly searches for p1 address. Then it sees that p1 also keeps address, so it goes straight to the a. Output = 10.
2nd Jan 2017, 5:04 AM
Dmitry Pudov
Dmitry Pudov - avatar