While reading this article, I came across the following declaration of function pointers. I haven't worked with such declarations, but the way I interpret it is that: the returned value of functionFactory when dereferenced is a function accepting 2 ints and returns an int.
int (*functionFactory(int n))(int, int) {
printf("Got parameter %d", n);
int (*functionPtr)(int,int) = &addInt;
return functionPtr;
}
I was curious to know whether such a declaration is specific to this case or is there a generic methodology that I have missed.
I mean we normally see declarations like
<returnType> funcName(listOfArgs){}
This one appears out of league. Could someone please elaborate.