GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Monday, February 28, 2011

Callback Function

/**
 * Callback function is a function that passed as argument 
 * parameter. It's called as argument parameter.
 */

#include <iostream>

using namespace std;

void hello(){
    cout << "Hello For You All Here" << endl;
}

// callback function
// function as argument parameter
void greeting(void (*func) (void)){
    func();
}

int main(int argc, char *argv[]){
    // callback function
    greeting(hello);

    return 0;
}

Share/Bookmark

No comments:

Post a Comment