Тема: Передача в функцію
не можу передати в функцію динамічний двовимірний масив, як це робиться?
#include <iostream> 
#include <stdlib.h>
#include <time.h>
using namespace std;
 
void newmas(int dmas1_[ ][ ], int mm, int nn,int indd,int indd2)
{        
    char ji;
        int i, j;
        int **dmas2 = new int*[mm];
        for (i = 0; i < mm; i++)
            dmas2[i] = new int[nn];
        if (indd == 1)
        {
            nn = +indd2;
            ji = i;
        }
        else if (indd == 2)
        {
            mm = indd2;
            ji = j;
        }
        cout << "======================================\n";
        for (i = 0; i < mm; i++)
        {
            for (j = 0; j < nn; j++)
            {
                if (indd == 1)
                {    
                    if (j>indd2 - 1)
                        dmas2[i][j] = dmas1_[i][j - indd2];
                    else dmas2[i][j] = 0;
                    cout << dmas2[i][j] << "\t";
                }
                else if (indd == 2)
                {
                    if (i>indd2 - 1)
                        dmas2[i][j] = dmas1_[i - indd2][j];
                    else dmas2[i][j] = 0;
                    cout << dmas2[i][j] << "\t";
                }
            }
            cout << endl;
        }
} 
 
void main()
{
    srand(time(NULL));
    int i, j, n, m, ind, ind2; 
    cout << "stvorennia massuvy\n";
    cout << "Shirina, Dovgota:";
    cin >> n >> m;
    int **dmas1 = new int*[m];
    for (i = 0; i < m; i++)
        dmas1[i] = new int[n];
    for (i = 0; i < m; i++)
    {
        for (j = 0; j <n; j++)
        {
            dmas1[i][j] = rand() % 25;
            cout << dmas1[i][j] << "\t";
        }
        cout << endl;
    }
    
    while (1)
    {
        cout << "kuda sdvigat? (1-storonu; 2-niz)";
            cin >> ind;
        if (ind == 1 || ind == 2)
        {
            break;
        }
        else
            cout << "ERROR\t";
    }
        cout << "na skilki?:";
            cin >> ind2;
 
    if (ind == 1)
    { 
        newmas(dmas1,m,n,ind,ind2);
          
    }
    else if (ind == 2)
    {
        newmas(dmas1, m, n, ind, ind2);
    }
    system("pause");
}