How to initialize static 2d array
I am trying to initialize static 2d array by statment 'static int b[n][m]={}' , it is showing error, while on giving const parameters, it's working 'static int b[2][10]={}'
#include<iostream>
using namespace std;
void a(int c, int n, int m){
static int b[n][m]={};
// static int b[2][10]={}; , here it is working fine
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
b[i][j] = i+j;
cout<<b[i][j]<<" ";
}
}
}
int main(){
int c;
cin>>c;
a(c,2,10);
cout<<endl;
return 0;
}