Path: utzoo!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!karln!karln!karln From: karln@uunet.uu.net Newsgroups: comp.lang.c Subject: More Pointers ... Message-ID: <1991Mar13.161322.8214@uunet.uu.net> Date: 13 Mar 91 16:13:22 GMT Reply-To: karln!karln@uunet.uu.net (Karl Nicholas) Organization: Sam76 - Pennington NJ Lines: 46 Something bothers me about this example program. I works, but I did not think the array passing and pointers would come out looking like this. I've tried other ways of doing this, but this seems to be the only way I can get it to work. Is there another way ??? [---------------------------Cut Here--------------------------] #include main() { int Board[3][3]; init_board( Board ); show_board ( Board ); } init_board ( Board ) int (*Board)[3][3]; { int i, j; for ( i=0; i < 3; ++i ) { for ( j=0; j<3; ++j ) { (*Board)[i][j] = 0; } } } show_board( Board ) int (*Board)[3][3]; { int i; for ( i=0; i < 3; ++i ) { printf("%d %d %d\n", (*Board)[i][0], (*Board)[i][1], (*Board)[i][2] ); } } [---------------------------Cut Here--------------------------] Specificly the use of Board seems strange. Should I be using int **Board somewhere? I did try using them at first, but things wouldn't work right. Anybody care to make ANY sort of comment here? Karl Nicholas karln!karln@uunet.uu.net