Dear Gurus,
I would like to implement a function that computes the number of times
a certain condition is met in a global array.
For example, I have an global array of size 500.
float array[500];
I have a function that finds the maximum of an array of size 50.
bool findMax50(float input[])
Next, I want to implement a function that can do the following;
Sum( findMax50(array), period)
If period is 20, then this function will start at the last element of
the global array and will return 1 if this element is a maximum among
the 50 elements it covers. Then, it moves on to the (last -1)th
element all the way to (last-20)th element. The Sum() function will
sum up the number of times maximum happened.
My greatest difficulty lies in how one can input a function as a
parameter into another function.
Can some Guru advise?