bool **** done = newbool***[maxLocation->x];
for(int o = 0; o < maxLocation->x; o++) {
done[o] = newbool**[maxLocation->y];
for(int j = 0; j < maxLocation->y; j++) {
done[o][j] = newbool*[maxLocation->z];
for(int u = 0; u < maxLocation->z; u++) {
done[o][j][u] = newbool[N];
for(int p = 0; p < N; p++)
done[o][j][u][p] = false;
}
}
}
Obviously this code is quite cumbersome since the entire array has static dimensions and all values are the same. I'm kinda expecting c++ to have an expression much like java that sais: bool ****done = newbool[maxLocation->x][maxLocation->y][maxLocation->z][N];
that does the trick just the same... Likewise, I don't like deleting this static array. Isn't there a simple function like: deleteMArray(done,newint[] {maxLocation->x,maxLocation->y,maxLocation->z,N}); where the given int array indicates the size of each dimension?
I mean, the code is easy enough to write myself, but it looks way too cumbersome and I can't believe there isn't a standard implemented for such a simple and frequently used structure...