I have a 2 dimension array in my cpp program which stores double values across eight columns and three rows.I have a function to determine the smallest value per row.Now i want to change the value of that smallest variable.I am passing the array via pointers and its challenging to me.Below is the getMaxMin() which gets the smallest values.Any help will be appreciated.
double **getMaxMin(double **scores){
for(int i=0;i<3;i++){
double small=scores[i][0];
for(int j=1;j<8;j++){
if(small>scores[i][j]){
small=scores[i][j];
}
}
cout<<small<<endl;
}
return scores;
}
double **in so the values inscoreswill be directly modified. You don't need to return anything from this function.