Can someone help me understand this kind of allocation
im more familiar with something like this:
result = array = malloc(sizeof(int *) * height);
for (i = 0; i < height; i++) {
array[i] = malloc(sizeof(int) * width);
}
the other allocation is this:
int len;
len = (*numObjs) * (*numCoords);
objects = (double **)malloc((*numObjs) * sizeof(double *));
objects[0] = (double *)malloc(len * sizeof(double));
for (i = 1; i < (*numObjs); i++)
objects[i] = objects[i - 1] + (*numCoords);
the values (*numObjs)
&& (*numCoords)
are taken from a file read which is 100000*20
.