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
<kamakshi...@gmail.com>wrote:

> @rakib:can u please explain ur answer
>
>
> On Sat, Jul 23, 2011 at 12:48 AM, Pankaj <jatka.oppimi...@gmail.com>wrote:
>
>> https://ideone.com/tr3Q7
>>
>>
>> On Sat, Jul 23, 2011 at 12:42 AM, Pankaj <jatka.oppimi...@gmail.com>wrote:
>>
>>> double **p= (double **) malloc(sizeof(double *));
>>>
>>>
>>> On Sat, Jul 23, 2011 at 12:40 AM, Bhavesh agrawal <agr.bhav...@gmail.com
>>> > 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 algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> 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 algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Regards,
> Kamakshi
> kamakshi...@gmail.com
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> 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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

<<attachment: 2d.jpg>>

Reply via email to