Thursday, February 15, 2007

Passing multidimensional arrays to functions

Got enlightened by this today. And realized the following.
int a[10][20];

int main(){
 print_array(a); /*results in a crash.*/

}

void print_array(int **a,int i,int j){
 printf("%d",a[i][j]); /*How stupid this can be?*/
}

No comments: