int **x;
x = new int*[n];
for (int i = 0; i < n; i++){
x[i] = new int[m];

This algorithm will create a m*n matrix.
x= new int*[n] is same as allocating array of n which will be of (Int *)
type. It will store the address of n arrays of m size.
x[i]= new int[m] here we are allocating an array of m int. And assigning the
address of each array to memory allocated above.

Please let me know if I am wrong.

On Sat, Jul 23, 2011 at 12:59 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.

Reply via email to