How many number of pointer (*) does C have against a pointer variable declaration?
a) One
b) Two
c) Multiple
d) None
Answer:
c) Multiple
Explanation:
In C, a pointer declaration can have multiple asterisks (*
), indicating that it is a pointer to a pointer, and so on. For example, int **ptr
declares a pointer to a pointer to an integer. The number of asterisks determines the level of indirection, with each asterisk representing another level.
Understanding how to declare and use multiple-level pointers is important for advanced memory management and working with dynamic data structures in C.