You need to use a function pointer. Function pointer declaration syntax:
rettype (*)(paramtype1,paramtype2,...,paramtypeN)
So, for example, we might have the following code:
char functionA(int x)
{
printf("%d\n",x):
return 'a';
}
char functionB(char (*f)(int), int val)
{
return f(val);
}
int main(int argc, char* argv[])
{
char result = functionB(&functionA,3);
printf("%c\n",result);
return 0;
}
, , & functionA A, ... , , , . , , .
, , , , -, . setjmp , longjmp, , . jmp_buf, , . , (, , setjmp ), setjmp.h jmp_buf. , , jmp_buf , .