I am using the following code to create dynamic 2D array.
uint32_t** arrays = new uint32_t*[10];
uint32_t number = take input from console ;
arrays[0] = new uint32_t[number];
number = take input from console ;
arrays[1] = new uint32_t[number];
delete arrays[0] ;
number = take input from console ;
arrays[0] = new uint32_t[number] ;
Can any one help me how to know the size of the 2nd dimension without knowing the input values ? Means how to find the array size on arrays[0], arrays[1] and so on ?
There is no way to determine the size of a memory block allocated by
newwithout storing the size value.EDIT: also, why not just use a
vector< vector< uint32_t > > arrays;?