variable ptrA needs to have three stars
#define maxrows 2
#define maxcols 5
int main()
{
double a[maxrows][maxcols];
double ***ptrA = malloc(maxrows * sizeof(double*));
int i,j;
for(i = 0; i < maxrows; i++)
{
ptrA[i] = malloc(maxcols * sizeof(double*));
for(j = 0; j < maxcols; j++)
{
ptrA[i][j] = &a[i][j];
}
}
}
Last edited by Ancient Dragon; Nov 5th, 2009 at 11:39 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,953 posts
since Aug 2005