void* is a generic pointer type in C++ that can point to any data type, but it does not retain information about the type of what it points to. Therefore, you cannot call f(5) since f is treated as a void*, and the compiler doesn’t know it’s meant to be a function pointer.
If you’re really stupid, you can do this (casting a void*)
this is done a lot in embedded programming lol
, to make it work you need
Note that if g returned an integer, you’d need to do this