In C, which operator is used for pointer-to-pointer relationships?

In C, which operator is used for pointer-to-pointer relationships?

a) & (ampersand)
b) * (asterisk)
c) -> (arrow)
d) [] (brackets)

Answer:

b) * (asterisk)

Explanation:

In C, the asterisk (*) operator is used to declare and manipulate pointers, including pointer-to-pointer relationships. A pointer-to-pointer is essentially a pointer that stores the address of another pointer. For example, int **pp is a pointer to a pointer that points to an integer. The * operator is used to dereference the pointers and access the values they point to.

Understanding pointer-to-pointer relationships is crucial for working with dynamic memory allocation and complex data structures in C programming.

Reference links:

https://www.rameshfadatare.com/learn-c-programming/

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top