What does **p means in c++, please explain with example?
Answers
Answered by
0
adowCODE (680)
*p1 = &x means p1 holds the address of x. In other words, p1 points to x.
*p2 = &p1 means p2 holds the address of p1. (ofcourse, p1 is a variable and has an address).
Hence, p2 is declared **p2 coz it holds the addess of a pointer that holds the address of another object.
p2 is therefore a pointer to a pointer.
*p1 = &x means p1 holds the address of x. In other words, p1 points to x.
*p2 = &p1 means p2 holds the address of p1. (ofcourse, p1 is a variable and has an address).
Hence, p2 is declared **p2 coz it holds the addess of a pointer that holds the address of another object.
p2 is therefore a pointer to a pointer.
Similar questions