I am a math student, recently I am thinking if
$f:A\to B$ and $g:B\to C$ are two functions (pointers) written in C, where $A,B,C$ are just three data types, is there a mechanism in C that allows creating a function pointer $h$ that when applies to some $x\in A$ has the same effect as $f\circ g$? i.e., $h(x)=g(f(x))$?
I know for two given function $f,g$, I can write a new function that returns $g(f(x))$, but I am asking if we can compose any two function pointers without writing a new function. This is useful when I pass a function pointer to some functions like qsort.