Invalid types 'int[int]' for array subscript error

can you please check what is the problem in this code which is throwing the error “invalid types ‘int[int]’ for array subscript”
here is the code:

hash include
using namespace std;

void rotateImage(int array[], int n){
// REVERSE THE ROWS and then TAKE TRANSPOSE:

// to reverse the rows
for (int i = 0; i < n; i++)
{
    int x= 0, y=n-1;
    while(x<y){
        swap(array[i][x], array[i][y]);
        x++;
        y--; 
    }
}

// to transpose the matrix
for (int i = 0; i < n; i++)
{
    for (int j = 0; j < n; j++)
    {
        while (i<j)
        {
            swap(array[i][j], array[j][i]);
        }
        
    }
    
}
cout<<"NEW ARRAY: "<<endl;
for (int i = 0; i < n; i++) 
{
    for (int j = 0; j < n; j++)
    {
        cout << array[i][j];
    }
    cout << endl;
}

}

int main()
{
int n;
cout << "Enter the value of row and column: ";
cin >> n;

int array[n][n];

for (int i = 0; i < n; i++) 
{
    for (int j = 0; j < n; j++)
    {
        cout << "Enter the value of array at position " << i << " , " << j << " : ";
        cin >> array[i][j];
    }
}

cout << "Original array: " << endl;
for (int i = 0; i < n; i++)
{
    for (int j = 0; j < n; j++)
    {
        cout << array[i][j];
    }
    cout << endl;
}

rotateImage(array, n);
return 0;}

@asthagrawal29,
you r passing 2d array in a wrong way check here ive corrected and commented : https://ide.codingblocks.com/s/656493

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.