0
passing a 2D array to a function
how do i pass a 2d array to a function in this code: int main(){ int x,y; cin >> x; cin >> y; int grid[y][x]; myFunc(grid); }
2 Answers
+ 2
Exactly as you did- myFunc(grid);
The problem is that you cant declare an array with a non-fixed length, you need to use "new" for that
+ 1
daniel what do you mean?