関数から別の関数に 2D 配列を渡そうとしています。ただし、配列のサイズは一定ではありません。サイズはユーザーが決定します。
私はこれを研究しようとしましたが、あまり運がありませんでした。ほとんどのコードと説明は、配列の一定サイズに関するものです。
私の関数A
では、変数を宣言し、それを少し操作してから、 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
}