I am trying to malloc or calloc a 2 dimensional array and it is not calloc-ing correctly. It zeros out the pointers to the rows (1D array), but callocing memory for the columns is not working.
short ** idx = (short**)calloc(size,sizeof(short*));
for(i = 0; i < size; i++)
idx[i] = (short*)calloc(size,sizeof(short));
Also, I am trying to access a different 2D array and am getting wrong results. It is not accessing the correct indexes and returning the correct values.
What can I do to correct this?
Thanks,
sal