I have several separate series that I am using to measure volatility. I'd like to sort the current values of each series in ascending order and pick out the five highest values for use in another function.

What is the best way to accomplish this in Lite-C?

I've tried passing the current value of each series to an element in an array (myarray[] = {series1[0], series2[0], ... , series12[0]} and then using the qsort function:

Code:
#include <stdio.h>
function run()
{
var myarray[] = {2, 6, 1, 9, 52, 3};
qsort(myarray, 6, 8, compare);	
}



This returns an error that seems to originate in stdio.h:

Error in 'stdio.h' line 228:
'API' undeclared identifier
< API(_fsopen,msvcrt)
>.

Can anyone suggest what I'm doing wrong, or a better approach to this problem?

Thanks in advance