I must create a large matrix (i.e. 10,000x10,000) with the spine as an array of float pointers:
typedef float* DynamicMatrix[MAT_SIZE];
DynamicMatrix matDyn;
Now i must allocate rows and initialize them to zero.
// allocate rows and initialize to 0
for (r = 0; r < MAT_SIZE; r++) {
matDyn[r] = new float[MAT_SIZE];
for (c = 0; c < MAT_SIZE; c++) {
matDyn[r][c] = 0;
}
}
Is my allocation and initialization correct?
What is the difference between allocation an array the way I did above and by saying something like float DynamicMatrix[10,000][10,000]?