πŸ“Š C Programming
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
  • (A) The value of A
  • (B) The address of p1
  • (C) The address of A
  • (D) None of the above
πŸ’¬ Discuss
βœ… 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.

Explanation by: Admin
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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
178
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Admin
Publisher
πŸ“ˆ
88%
Success Rate