I saw an answer in stackoverflow regarding how to pass a 2d-array
in a function there are 3 or more methods given when I tried one of them it worked just fine. But when I'm trying to use that method in backtracking it is giving me an error.
I tried declaring it globally but I want to learn how to use it this way
#include<bits/stdc++.h>
using namespace std;
int callAgain(int,int);
int call(int,int);
int call(int arr[][5],int n)
{
if(n==1)
return 0;
cout<<"anything";
callAgain(arr,n-1); //getting error here.
return 0;
}
int callAgain(int arr[][5],int n)
{
call(arr,n);
return 0;
}
int main(){
int arr[5][5];
memset(arr,0,sizeof(arr));
call(arr,5);
return 0;
}
error: invalid conversion from int(*)[5] to int [-fpremissive]