NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
ex_ArrayMax.nxc

This is an example of how to use the ArrayMax function.

task main()
{
int data[40];
for (int i = 0; i < 40; i++)
data[i] = Random();
TextOut(0, LCD_LINE1, "Max value = ");
int x = ArrayMax(data, NA, NA); // start at 0 and go to length(data);
NumOut(0, LCD_LINE2, x);
}