Function call through mismatched function pointer type
suggest changeIn order to call a function through a function pointer, the function pointer’s type must exactly match the function’s type. Otherwise, the behaviour is undefined. Example:
int f();
void (*p)() = reinterpret_cast<void(*)()>(f);
p(); // undefined
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents