Hi,
Yes, Origin C does support function pointer. The following code shows a simple example on how to use function pointer.
// define function pointer type
typedef double (*FUNC_POINTER)(double);
// define callback function
double func(double a)
{
return a*2;
}
// function pointer as parameter
double FuncCall(FUNC_POINTER myfunc, double a)
{
return myfunc(a) + 1; // using function pointer
}
// testing function
void testFuncCall()
{
double dd = FuncCall(func, 1); // pass a function as parameter
out_double("", dd); // shoule output 3
}
Penn