I have seen many questions of this type on SO, but nothing really helped.I'm a newbie in C++.
#include<iostream>
using namespace std;
int func(int i,int j,int r,int c,int **A)
{
//do something
}
int main(void)
{
int r,c;
cin>>r>>c;
int A[r][c];
//read array
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
cin>>A[i][j];
}
}
if(func(0,0,r,c,A)){
cout<<1<<endl;
}
else{
cout<<0<<endl;
}
}
this gives the following error
error: cannot convert ‘int (*)[c]’ to ‘int**’ for argument ‘5’ to ‘int func(int, int, int, int, int**)’ if(func(0,0,r,c,A)){