Hi,i am new to c++ and i want to write a programm to generate an integer array. I keep getting the error at line 25: invalid types 'int[int]' for array . can anyone tell me what's wrong here. Thanks in advance.
int main()
{
int rows;
int cols;
cin>>rows>>cols;
int test[rows][cols];
get_test(rows,cols,&test[0][0]);
cout<<test[1][1]<<endl;
return 0;
}
int get_test(int rows,int cols,int *test)
{
int h=rows;
int w=cols;
int i=0,j=0;
for(i=0;i<h;i++)
{
for (j=0;j<w;j++)
{
test[i][j]=i;
}
}
return 0;
}