3 ms·
Which class are functions in C? It was my impression that the only thing missing were anonymous functions, but there are pointers to functions if I'm not mistak
by VMG 15y ago
Which class are functions in C? It was my impression that the only thing missing were anonymous functions, but there are pointers to functions if I'm not mistaken.
- nandemo 15y ago> Which class are functions in C? Economy class. :-) In general, how do you write functions that return functions without some form of anonymous function? For instance, how do you write a function that takes an int a and returns a function that takes an int parameter and returns non-zero if and only if that parameter is greater than a?
- bwarp 15y agoYou can use function pointers. Functions in C are not first class (they are not a type) but you can emulate higher order functions crudely using function pointers. It gets ugly pretty quick though.