largest element in a row and column

closed account (Lhp9GNh0)
Row = 12
largest = matrix [12][0];
for (col = 1; col < 2; col ++)
If (largest < matrix [12][2])
Largest = matrix [12][2];
if i wanted to make this a function i would have to store it in code like this right?

int hitemp(int largest)
{
int row, largest, col,

Row = 12
largest = matrix [12][0];
for (col = 1; col < 2; col ++)
If (largest < matrix [12][2])
largest = matrix [12][2];
return largest;
}
can i change the name of the matrix array, and largest?
and i know column is just reverse row with column, but how do you find the lowest number?
comment on syntex please, im a college student and i get it but i dont get it.
What is the precise purpose of the function?

A handy shortcut for getting the minimum or maximum of two numbers is

x = std::min(a, b);
or
x = std::max(a, b);

If you want to assign x to the lower of itself or another number:

x = std::min(x, a);
Topic archived. No new replies allowed.