ExamVeda
Login
Home
This question belongs to C Program C Fundamentals
C Fundamentals
?

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

Answer & Solution
Correct Answer: Option A
In C, the operator used for pointer-to-pointer relationships is Option A: *. The asterisk () operator is used for both declaring and dereferencing pointer variables. When you have a pointer-to-pointer (a pointer that points to another pointer), you use multiple asterisks to access the value pointed to by the second pointer.

So, the correct answer is:
Option A: *
Here's an example of a pointer-to-pointer relationship in C:
int num = 42;
int *ptr1 = # // Pointer to an integer
int **ptr2 = &ptr1; // Pointer to a pointer to an integer

// Access the value using the pointer-to-pointer
int value = **ptr2; // value is now 42
In this example, ptr2 is a pointer-to-pointer, and **ptr2 is used to access the value stored in num.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.