Please any one can help me regarding function call for three dimensional array.
How to send result of three dimensional array to main function.
|
Go4Expert Founder
|
![]() |
| 13Nov2007,09:52 | #2 |
|
You need to pass the pointer.
|
|
Go4Expert Member
|
![]() |
| 28Nov2007,15:31 | #3 |
|
Can u explain me with an example please.
|
|
Ambitious contributor
|
|
| 28Nov2007,17:14 | #4 |
|
For any array, say
Code:
int arr[2][3][4]; Code:
void foo ( int arr[2][3][4] ); Code:
void foo ( int arr[2][3][4] ) {
// do stuff with arr[x][y][z]
}
Note that all these are equivalent. Code:
void foo ( int arr[2][3][4] ); void foo ( int arr[][3][4] ); // size of major dimension is optional void foo ( int (*arr)[3][4] ); // using explicit pointer notation The call to the function would be just Code:
foo( arr ); |
|
Go4Expert Founder
|
![]() |
| 28Nov2007,17:23 | #5 |
|
Share the code you are having trouble and we can look into it and show you the problem areas.
|


