unusual error in function solve when I pass the dp array to the function.
int n,k;
int solve(int n, int k, int dp[n+1][k+1])
{
// some code
}
int main(){
int t; cin>>t;
while(t--){
cin>>n;
cin>>k;
int dp[n+1][k+1];
memset(dp, -1,sizeof(dp));
cout<<solve(n,k,dp)<<endl;
}
return 0;
}
why this error: use of parameter outside function body before '+' token int solve(int n, int k, int dp[n+1][k+1]) I am not able to understand why is this error