Pointer to a Pointer..

In C and C++ we have this pointer. And then we have a pointer to that pointer.

Just have a query .. what exactly is the use of the ptr to ptr ?? Is it designed to make the life of software learners complicated or it has a real use in life ??

:slight_smile:

I'm not sure what you understand by a "pointer to a pointer", but it may be necessary as an argument to a method in order to allow the method to change what the pointer points to.

Ardubit:
Just have a query .. what exactly is the use of the ptr to ptr ??

One use would be for dynamically allocating multi-dimensional arrays. See Example #3 Here.

They are also useful for traversing and manipulating linked lists.

I think this Numberphile video explained it well: Triple Ref Pointers - Computerphile - YouTube

Pieter