How do I find the maximum value of a 3 dimensional array?


int foo [2][2][14]; 

What is the most elegant way to find the maximum value of foo?

In reply to new_to_uvm:
I don’t know if I would call this elegant, but it is the simplest.

int foo [2][2][14]; 
int max;
max = foo[0][0][0];
foreach (foo[i,j,k]) if (foo[i][j][k] > max)
                 max = foo[i][j][k];