Anyone can tell me that how can I use 2d array as argument in function dynamically | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Anyone can tell me that how can I use 2d array as argument in function dynamically

1st May 2021, 10:55 AM
Harsh Pratap Singh
Harsh Pratap Singh - avatar
1 Answer
+ 1
Get the int demensions of the array. Pass them first along with the array and put them in: void print_array(int x, int y, int arr[x][y]); ... int x,y; ... ... x = 4 y = 3 int my_arr[x][y]; ... //then just pass everything to the function
1st May 2021, 11:18 AM
Slick
Slick - avatar