Here's what seems to be a nice solution in case anyone else is interested:
Code:
#include <stdio.h>
int function(int a,double x) {
int b = (x+0.05)*10;
return a*100+b;
}
int main(void){
#define rows 4
#define cols 3
int col,row;
int array[cols][rows]={0};
for (row=0; row<rows; ++row)
for (col=0; col<cols; ++col)
array[col][row] = function (row+20, (col+1)*0.1);
for (row=0; row<rows; ++row) {
for (col=0; col<cols; ++col)
printf("%d ",array[col][row]);
printf("\n");
}
}
(I think array could have been defined as array[rows][cols] too, with other
subscripts also reversed.)
--
Bartc