Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~318 People Reached
Favorite Forums
Favorite Tags
c x 3
Member Avatar for iAndrewMeyer

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

Member Avatar for Trentacle
0
136
Member Avatar for iAndrewMeyer

I am trying to store the permutations generated by the recursive permutation function so that I can use them in main; however, I cannot figure how to get them to store correctly. I.E. when I run this function with a string AB, inside the recursive AB and BA gets printed …

Member Avatar for VernonDozier
0
182