I'm trying to pass a 2D array from a function to another function. However, the size of the array is not constant. The size is determined by the user.
I've tried to research this, but haven't had much luck. Most code and explanations are for a constant size of the array.
In my function A
I declare the variable and then I manipulate it a bit, and then it must be passed to Function B
.
void A()
{
int n;
cout << "What is the size?: ";
cin >> n;
int Arr[n-1][n];
//Arr gets manipulated here
B(n, Arr);
}
void B(int n, int Arr[][])
{
//printing out Arr and other things
}