/**
* Callback function is a function that passed as argument
* parameter. It's called as argument parameter.
*/
#include <iostream>
using namespace std;
void hello(int a){
cout << a << endl;
}
// callback function
// function as argument parameter
void greeting(void (*func) (int)){
int b = 45; // initialization
int b = 45; // initialization
func(b);
}
int main(int argc, char *argv[]){
// callback function
greeting(hello);
return 0;
}
No comments:
Post a Comment