Ошибка при вызове рекурсии в функции с динамическим двумерным массивом(определение детерминанта)

Пишу функцию определение детерминанта n-ого порядка квадратной матрицы. При компиляции ругается на вызов рекурсии.

#include <iostream>
#include <math.h>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <ctime>
#include <vector>
#include <fstream>
using namespace std;

int deter(int ** matrix, int n1){
    int matrix_previous[n1-1][n1-1];
    for(int i=0; i<n1-1;i++){
        for(int j=0;j<n1-1;j++){
            matrix_previous[i][j]= matrix[i+1][j+1];
        }
    }
    int res=1337;
    for(int i=1;i<=n1;i++){
        res = pow(-1, i+1)* matrix[0][i] * deter(matrix_previous, n1-1);
    }
    return res;
}

int main(){
    srand(time(0));
    int n=1;
    cin>>n;
    int **mas=new int *[n];
    for(int i=0;i<n;i++){
        mas[i]= new int [n];
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            mas[i][j]= rand()%10;
            cout<<mas[i][j];
            cout<<" ";
        }
        cout<<endl;
    }
    cout<<"deretminant: ";
    cout<<deter(mas, n);
}

Сама ошибка: no matching function for call to'deter'

no matching function for call to'deter'


Ответы (0 шт):