#include <iostream>
using namespace std;

void pop(int s, int n)
{
    for (int l = 0; l < n; l++)
    {
        for (int i = 0; i < n; i++)
        {
            cout << s[l][i]  << "\t";
        }
        cout << endl;
    }
}

int main()
{
    int n, num;

    cout << "Enter the Number of matrix -> ";
    cin >> n;

    int s[n][n];

    for (int l = 0; l < n; l++)
    {
        for (int i = 0; i < n; i++)
        {
            s[l][i] = l+i;
        }
    }

    pop(s, n);

    system("pause");
    return 0;
}

need some help with passing multidimensional array to a function.
thanks in advance.

First

int n, num;
    cout << "Enter the Number of matrix -> ";
    cin >> n; 
    int s[n][n];

The n variable needs to be constant, unless your compiler allowed it,
which is not good.

To pass a multidimensional array you need this :

const int FIXED_COL = 5;
void print(int A[][FIXED_COL], int rowSize);

The compiler needs to now the size of the column for a 2d array.

This question has already been answered. Start a new discussion instead.