3 ms·
int call(int(*func)(int), int value) { return func(value); } At least in gcc, you don't need to think about pointers. Just use the function signature:
by Izkata 3y ago
int call(int(*func)(int), int value) {
return func(value);
}
At least in gcc, you don't need to think about pointers. Just use the function signature:
int call(int func(int), int value) {
return func(value);
}
I don't know if this is an extension or what, but it's something I "just tried" on a hunch with no guide in 2009 and it worked.