As I know pointer can store the address of another variable.
In the program I have a pointer variable ptr which stores the address of the variable a. I have another pointer variable dptr which stores the address of the first pointer ptr.
location of ptr 0061FF14
dptr hold address of ptr is : 0061FF14
double pointer holds the address of the first pointer.
Because if I want to store the address of the first pointer, then I declare two pointers.
@WBahn why should we use double pointer? While we have pointer that can do the same thing as double pointer do?
In the program I have a pointer variable ptr which stores the address of the variable a. I have another pointer variable dptr which stores the address of the first pointer ptr.
C:
#include<stdio.h>
int main ()
{
int a = 10;
int *ptr = &a;
printf("location of ptr %p \n", &ptr);
int *dptr = &ptr;
printf(" dptr hold address of ptr is : %p", dptr);
return 0;
}
dptr hold address of ptr is : 0061FF14
double pointer holds the address of the first pointer.
Because if I want to store the address of the first pointer, then I declare two pointers.
@WBahn why should we use double pointer? While we have pointer that can do the same thing as double pointer do?


