hi all,
how can i write a function which receives a 2-d array?
my version:
it can't be compiled, here's error mesaageCode:#include <stdio.h> int main(void) { void fun(int *arr[10]); int twodarray[10][10] = {0}; fun(twodarray); return 0; } void fun(int *arr[10]) { int i; for(i=0; i<10; i++) { printf("%d", arr[0][i]); } }
Code:9 D:\Programes\OfficeWork\Dev-Cpp\Fun2darray\main.cpp cannot convert `int (*)[10]' to `int**' for argument `1' to `void fun(int**)'not working neitherCode:void fun(int **arr) {....}
BTW, how can i deal with a 3-d array?
many thanks!



LinkBack URL
About LinkBacks




