Possible Duplicate:
How do you pass a function as a parameter in C?
Suppose I have a function called
Another way to do it is using the functional library.
std::function
Here reads an example, where we would use funct2 inside funct:
#include
using namespace std;
#include
void funct2(int a) {cout << "hello " << a << endl ;}
void funct(int a, function func) {func(a);}
int main() {
funct(3,funct2);
return 0;}
output : hello 3