Q. According to the following statements, what is the output of “p2”?
Code:
int A = 5; int *p1 = &A; // p1 points to A int **p2 = &p1; // p2 points to p1
β
Correct Answer: (B)
The address of p1
Explanation: A pointer is an object (Lvalue) whose value is equal to the address of another object. A pointer is declared by the following instruction:
type *pointer-name;
Where type is the type of the pointed object. This declaration declares an identifier, ‘pointer-name’, associated with an object whose value is the address of another object. The identifier ‘pointer-name’ is an address identifier. As for any Lvalue, its value is modifiable.