Use 2D array in a function C++ : <p>I need to use a square 2D array (arr[n][n]) in a C++ void function that creates a latin square but the requirement is that the size of n is not given at the start of program. The user has to input the size of array. Example of my code (that is failing):</p>

<pre><code>    int n;
    void arrayz(int n , int arr[][])
    {
        for (int i = 0; i &lt; n; i++)
            {
                for (int k = 0; k &lt; n; k++)
                {
                    for (int e = 1; e &lt;= n; e++)
                    {
                        arr[i][k] = e;
                    }
                }
            }
    }
    int main()
    {
            int arr[n][n];
            cin &gt;&gt; n;
            void arrayz (n, arr[n][n])
    }
</code></pre>

<p>Please help me with this problem!</p>
