Does anyone know how to use a void pointer to generate a 2D array rather than an int pointer?
For integer pointer, I do as follow:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
int **m;
m = new int* [row];
for(int i=0; i< row; i++)
m[i] = new int[col];
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
m[i][j] = rand () % 10;
}
}
| |
What if the pointer type is void***m?
How can I define the storage like int? eg.(m = new int* [row];)
Thanks for your help.
Last edited on
Hi PanGalactic!
Thanks for your reply. However, it's nothing related to the vector, It's just a pointer of void type to create 2 Dimensional Dynamic Array.
Would you please give a complete example so that I can understand clearer?
Cheers!
Nobody know the answer ???
Please...guys!