Hi,
I'm doing quite a simple thing which is giving me problems. I m allocating memory for a 3dimensional array as the following:
double ***alloc()
{
double ***tp;
int x;
long t;
tp=(double ***)calloc(maxt ,sizeof(double **));
for(t=0;x<=maxt ;t++)
tp[t]=(double **)calloc(maxx+ 1,sizeof(double *));
for(t=0;t<=maxt ;t++)
for(x=0;x<=maxx +1;x++)
tp[t][x]=(double *)calloc(maxy+1 ,sizeof(double) );
return tp;
}
however when i call this function, the program exits and does not execute the rest of the commands in the main().
PLease have anyone ecountered such a problem?
I m using lcc-win as a compiler,
regards
alan
I'm doing quite a simple thing which is giving me problems. I m allocating memory for a 3dimensional array as the following:
double ***alloc()
{
double ***tp;
int x;
long t;
tp=(double ***)calloc(maxt ,sizeof(double **));
for(t=0;x<=maxt ;t++)
tp[t]=(double **)calloc(maxx+ 1,sizeof(double *));
for(t=0;t<=maxt ;t++)
for(x=0;x<=maxx +1;x++)
tp[t][x]=(double *)calloc(maxy+1 ,sizeof(double) );
return tp;
}
however when i call this function, the program exits and does not execute the rest of the commands in the main().
PLease have anyone ecountered such a problem?
I m using lcc-win as a compiler,
regards
alan
Comment