Am I freeing and declaring this 2d array correctly?
int **ratings;
ratings = (int**)malloc(sizeof(int *) * (numCouples*2));
for(i=0; i<numCouples*2*numCouples;i++)
ratings[i] = (int*)malloc(sizeof(int) * numCouples);
//Data is read into each array position
for(i=0; i<numCouples*2;i++)
for(j=0;j<numCouples;j++){
fscanf(ifp, "%d", &ratings[i][j]);
//printf("%d",ratings[i][j]);
}
for(i=0;i<(numCouples*2);i++)
free(ratings[i]);
free(ratings);
Thanks
Drew