+ 1
Why is the output 5 and not p2?
int a=5; int *p1 = &a; int **p2 = &p1; int ***p3 = & p2; cout << ***p3;
2 RĂ©ponses
+ 4
Out put is 5 because:
Firstly, p3 points to p2
Then, p2 points to p1
Then, p1 points to a
Lastly, a is equal to 5
so p3 is also equal to 5
The â&â symbol is a pointer used to point to a space
p3 points all the way to a which is equal to 5
+ 4
I think before understanding the output you should understand "what is pointers?"
https://www.sololearn.com/learn/CPlusPlus/1630/