+ 4

What is the double pointer.

9th Oct 2019, 4:36 AM
Gopal Krishna Sharma
Gopal Krishna Sharma - avatar
2 ответов
+ 8
I think you mean by Pointer pointing to a Pointer. Example : /*C program to demonstrate pointer to pointer */ int main() { int var = 789; // pointer for var int *ptr2; // double pointer for ptr2 int **ptr1; // storing address of var in ptr2 ptr2 = &var; // Storing address of ptr2 in ptr1 ptr1 = &ptr2; // Displaying value of var using // both single and double pointers printf("Value of var = %d\n", var ); printf("Value of var using single pointer = %d\n", *ptr2 ); printf("Value of var using double pointer = %d\n", **ptr1); return 0; }
9th Oct 2019, 4:54 AM
Ankur
Ankur - avatar
+ 4
Do you mean a pointer to a pointer?
9th Oct 2019, 4:53 AM
Sonic
Sonic - avatar