Originally Posted by
manasij7479
How is payoff declared ?
(Guessing) Shouldn't you assign the result of malloc to payoff and not payoff[i][j] ?
Thats not the issue, its working for all values of temp less than 10^4.. anyway. My declaration and allocation is ; ( here MEM_ERROR is macro)
Code:
double ***payoffs = NULL;
...................................
for(i =0; i < players; i++)
{
temp = profile/actions[i];
payoffs[i]= (double**)malloc(sizeof(double*));
if( payoffs[i] == NULL)
MEM_ERROR
maximum[i]= (char **)malloc(sizeof(char *));
if( maximum[i] == NULL)
MEM_ERROR
for(j = 0; j < actions[i]; j++)
{
maximum[i][j] = (char *) malloc(sizeof(char*)*temp);
if ( maximum[i][j] ==NULL)
MEM_ERROR
printf(" i am upto here %d %d %d\n", i, j, temp);
payoffs[i][j] = malloc(sizeof(double)*temp);
if( payoffs[i][j] == NULL)
MEM_ERROR
printf("but not upto here\n", i,j);
}
}