If I had an array defined as follows in C:
int B[d1][d2][d3][d4][d5][d6][d7][d8][d9];
Then it is easy to convert "B" into single dimensional one. But what if I have an array in C, which is defined as follows:
int********* A;
//which will be allocated as follows for example
A = (int*********) malloc(N*sizeof(int********));
for(int i=0; i<N; i++)
{
//differentSizes will be distinct for every "i"
//the same distinctness of sizes will be for every other
//inner parts of all inner for loops
compute(&differentSizes);
A[i] = (int********) malloc(differentSizes*sizeof(int*******));
for(...)
{
...
}
}
Where "A" will have very large sizes for every dimension and they will all be distinct for all the innerarrays/subarrays of "A".
My question: Is there an efficient way to convert "A" into a single dimensional one? If possible can you show a simple example? Thanks!