I have two matrices that are input from data files. I'm trying to find the maximum value in the FIRST matrix only. I wrote some code that I thought would do something like this, but the program crashes when I test it. Also, this is in a switch statement as a menu option. Any suggestions?
switch (menuChoice)
{
case'1':
maximumValue (a, s, t);
break;
void maximumValue (double a[][20], int s, int t)
{
int i, j;
double max;
max = a[0][0];
for (i=0; i <= s-1; i++)
{
for (j=0; j <= t-1; i++)
{
if (a[i][j] > max)
max = a[i][j];
}
}
cout << " Maximum value = " << fixed << setprecision(2) << setw(8) << right << max << endl;
}