I'm trying to use a function pointer that is taking another function pointer with an argument. So f2() is the argument to the first function.
But I'm getting an error saying "error: lvalue required as unary ‘&’ operand".
Am I doing something that is'nt possible? Or how shall I implement this?
Code:#include <stdio.h> #include <stdlib.h> typedef void(*funcPtr)(void(*ptr)(int)); void f1(void (*op)(int b)) { printf("%s() - \n", __func__); (*op)(b); } void f2(int b) { printf("%s() - b: %d\n", __func__, b); } int main() { funcPtr pF1 = NULL; pF1 = f1; pF1(&f2(5)); return 0; }