Double pointer is a pointer to a pointer. Lets us explain it using below example:
int a = 10;
int *ptr_1;
ptr_1 = &a;
int **ptr_2;
ptr_2 = &ptr_1;
The above code declared a variable 'a' and 'ptr_1' is holding the address of 'a'. 'ptr_2' is another pointer which holds the address of 'ptr_1'. 'ptr_2' is a double pointer as it points to the address of another pointer.
Access the video on this topic from below link:
2 Comments
In Line 3 you probably mean "ptr_1" instead of "ptr"
ReplyDeleteYou are absolutely right.. Thanks for pointing out.. common overlook errors in programming
Delete