Top "Function-pointers" questions

A function pointer is a pointer to a function, which can be stored in a variable.

C++ function types

I have a problem understanding function types (they appear e.g. as the Signature template parameter of a std::function): …

c++ c++11 function-pointers std-function
Does Function pointer make the program slow?

I read about function pointers in C. And everyone said that will make my program run slow. Is it true? …

c pointers function-pointers
How to create map<string, class::method> in c++ and be able to search for function and call it?

I'm trying to create a map of string and method in C++, but I don't know how to do it. …

c++ mapping function-pointers
static vs extern "C"/"C++"

What is the difference between a static member function and an extern "C" linkage function ? For instance, when using "makecontext" …

c++ function-pointers static-members linkage extern-c
Error with address of parenthesized member function

I found something interesting. The error message says it all. What is the reason behind not allowing parentheses while taking …

c++ function-pointers pointer-to-member
C syntax for functions returning function pointers

Consider the following typedefs : typedef int (*f1)(float); typedef f1 (*f2)(double); typedef f2 (*f3)(int); f2 is a function …

c function-pointers
Convert C++ function pointer to c function pointer

I am developing a C++ application using a C library. I have to send a pointer to function to the …

c++ c pointers function-pointers
Why can I invoke a function via a pointer with too many arguments?

Say I have this function: int func2() { printf("func2\n"); return 0; } Now I declare a pointer: int (*fp)(double); This …

c function-pointers calling-convention
Executing machine code in memory

I'm trying to figure out how to execute machine code stored in memory. I have the following code: #include <…

c segmentation-fault function-pointers casting
std::function to member function

#include <functional> struct A { int func(int x, int y) { return x+y; } }; int main() { typedef std::function&…

c++ function-pointers