>I don't know how to pass 2D-array to function...
You have it right except for one thing, when passing multidimensional arrays to a function, you must specify the size of all but the first dimension:
Code:
#include <stdio.h>
int kira(const int nom[][3])
{
int jumlah;
int i,j;
jumlah =0;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
jumlah = jumlah + nom[i][j];
}
}
return jumlah;
}
int main(void)
{
int total, nom[3][3];
int i,j;
for(i=0;i<3;i++)
for(j=0;j<3;j++)
nom[i][j] = 1;
total = kira(nom);
printf("Jumlah = %d\n", total);
return 0;
}
-Prelude