Please Help me When ever
Getting error “array bound is not an integer constant before ']' token”
#include <iostream>
using namespace std;
int maxr;
int maxc;
void readmatrix(int m[maxr][maxc]); // size depend upon input of maxr and
// maxc
main()
{
cout<<"enter Number of Row :";
cin>>maxr;
cout<<"enter Number of columb :";
cin>>maxc;
}
you declare an array with index specified with non constant variable.
when you declare 2d array , the 2nd index must be specified only with a number or a constant variable.