/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>

#define IX(r,c) r*ncol+c

void f(int *a, int nrow, int ncol)
{
   printf("%d\n",a[IX(4,4)]);
   a[IX(2,5)] = 321;
}

int main()
{
  int nrow = 100;
  int ncol = 10;
  int mx[ncol*nrow];
  mx[IX(4,4)] = 123;
  f(mx, nrow, ncol);
  printf("%d\n",mx[IX(2,5)]);
  return 0;
}
