C++语言程序设计

处理二维数组也类似于一维数组，通常用一个二重循环语句。例如下面的程序就是用一个二重循环语句在数组seasonTemp中查找最高温度：

| 例6-7

const int rows = 3;
const int columns = 4;
int seasonTemp[rows][columns] = {
{26, 34, 22, 17},
{24, 32, 19, 13},
{28, 38, 25, 20}
};
int HighestTemp (int temp[rows][columns])
{
int highest = 0;
for (register i = 0; i < rows; ++i)
for (register j = 0; j < columns; ++j)
if (temp[i][j] > highest)
highest = temp[i][j];
return highest;
}