In C (and so many other "low-level" languages), functions have a type. You can declare a variable with a type that matches a function and can assign a function to such a variable, yet people insists that functions are not first class citizen in C.
Using pointers to functions and passing functions to other functions as arguments is key in several standard functions in C; qsort
for example, require a comparison function to be passed or it can't do anything.
It is not uncommon to see "object-oriented" programming in C, by declaring a struct
with several variables with function-types. Callbacks can be and often are (if not always -- I can't imagine any other way to do it) implemented using variables with function-types or struct
s with members with function types.
So, why aren't functions considered first class citizens in C?
(I'm sure this is duplicate, but I can't seem to find any similar questions here)