I'm currently working on a code that uses many 2-4D matrices.
For example, one of my 4D matrices is initialized like this: double (*kse)[nIStats+1][nDofs-nDim+1][nDim+1]=newdouble[nEles+1][nIStats+1][nDofs-nDim+1][nDim+1]
I would like to set all of these pointers to NULL at first and then assign values to them as needed.
Do you want assign NULL to pointers llike that double (*kse)[nIStats+1][nDofs-nDim+1][nDim+1] or assign zeroes to elements of arrays you allocate?
If you want to init elements of arrays to sero you should write
No, I want to set the pointers to point to NULL (so that they don't take up any space in memory), so that if I try and erase them later and they are not allocated, I do not get an error.