Function call through mismatched function pointer type

suggest change

In 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

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents