I have been trying to return a two dimensional array in a function but it is getting me no where, please tell me how to do it. the code is as follow :
int *population();
int *testCase::population()
{
for(int i=0;i<3;i++)
{
for(int j=0;j<2;j++){
matrix[i][j]=rand()%2;
}
}
return matrix[0][0];
}
when I run the program, it returns a memory address. I want it to return the value for the array.
Regards