void input(int B[XAM][XAM])
{ int i,j,a;
for (i=0;i<3;i++) {
for (j=0; j<3; j++) {
scanf("%d",&B[i][j]);
}
}
for (i=0;i<3;i++) {
for (j=0; j<3; j++) {
printf("%d ",B[i][j]);
}
printf("\n");
}
}
void main()
{
#define XAM 3
int pilih,A[10],B[3][3],i,j;
input(&B[XAM][XAM]);
for (i=0;i<3;i++) {
for (j=0; j<3; j++) {
printf("%d ",B[i][j]);
}
printf("\n");
}
getch();
}
why when i try to run the program, I already used "Pass by reference", but still when I call the output from void main, the output didn't the same as my input from the procedure, but if I call the output from the procedure, there is no problem can someone help me why pass the reference didn't work? thanks