Well a "double" pointer (A more accurate term is multidimensional pointer,
in this case a two dimensional pointer) is basically a pointer to an array
of pointers.

So, int **ptr basically says, ptr is a pointer to an array of pointers. And
you can allocate memory to each of these pointers individually. See the
image.

Heres something interesting.

int **ptr;
*ptr = new int*[3]; // ptr points to THREE << pointers to integers >>
ptr[0] = new int [10];
ptr[1] = new int[23];
ptr[2] = new int[12];




On Sat, Jul 23, 2011 at 1:29 AM, Kamakshii Aggarwal
<[email protected]>wrote:

> @rakib:can u please explain ur answer
>
>
> On Sat, Jul 23, 2011 at 12:48 AM, Pankaj <[email protected]>wrote:
>
>> https://ideone.com/tr3Q7
>>
>>
>> On Sat, Jul 23, 2011 at 12:42 AM, Pankaj <[email protected]>wrote:
>>
>>> double **p= (double **) malloc(sizeof(double *));
>>>
>>>
>>> On Sat, Jul 23, 2011 at 12:40 AM, Bhavesh agrawal <[email protected]
>>> > wrote:
>>>
>>>> double pointer mean like     **p
>>>>
>>>> hoe to allocate memory for this
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected].
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards,
> Kamakshi
> [email protected]
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

<<attachment: 2d.jpg>>

Reply via email to