Two-dim. C array as double pointer

C functions taking a two-dimensional array as argument will normally represent the array as a double pointer:
void gridloop1_C(double **a, double *xcoor, double *ycoor, 
               int nx, int ny, Fxy func1)
{
  int i, j;
  for (i=0; i<nx; i++) {
    for (j=0; j<ny; j++) {
       a[i][j] = func1(xcoor[i], ycoor[j]);
    }
  }
}
Fxy is a function pointer:
typedef double (*Fxy)(double x, double y);
An existing C library would typically work with multi-dim. arrays and callback functions this way

previousnexttable of contents