How to pass 3D array in function | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to pass 3D array in function

13th Jul 2019, 7:39 PM
Arpit Bhalla
Arpit Bhalla - avatar
6 Answers
+ 2
int ***arr and you can use it like this *(*(*(arr+i)+i)+i) to access the elements
14th Jul 2019, 1:42 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 2
No i want to send int rows, cols as a parameter.
14th Jul 2019, 1:36 PM
Arpit Bhalla
Arpit Bhalla - avatar
+ 2
How
14th Jul 2019, 1:40 PM
Arpit Bhalla
Arpit Bhalla - avatar
+ 2
Thanks
14th Jul 2019, 1:45 PM
Arpit Bhalla
Arpit Bhalla - avatar
+ 1
you need to pass it with the size like this int arr[10][10][3]
13th Jul 2019, 7:47 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 1
its better you use pointer
14th Jul 2019, 1:39 PM
✳AsterisK✳
✳AsterisK✳ - avatar