Determining to which function a pointer is pointing in C?

后端 未结 9 1107
情话喂你
情话喂你 2021-02-01 12:25

I have a pointer to function, assume any signature. And I have 5 different functions with same signature.

At run time one of them gets assigned to the pointer, and that

9条回答
  •  不要未来只要你来
    2021-02-01 13:18

    The function names will not be available at runtime.

    C is not a reflective language.

    Either maintain a table of function pointers keyed by their name, or supply a mode of calling each function that returns the name.

提交回复
热议问题