Start here · Essential guide
How to Pass a Function as an Argument in C++
Learn three ways to pass a function as an argument in C++: function pointers, templates and std::function, with lambda examples you can compile and run.
Syntax and Functions
How to pass a function to another function using pointers and other callables.
Start here · Essential guide
Learn three ways to pass a function as an argument in C++: function pointers, templates and std::function, with lambda examples you can compile and run.
Yes, you can pass a function as a parameter. Learn how function pointer parameters work in C and C++, with a runnable example in each language.
The asterisk declares a pointer in C. Learn what the ampersand and arrow do instead, with short examples, including how function pointers are declared.
Related topics