GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Thursday, April 7, 2011

C - Function Call

Here's a way on how to call function like the most avaiable in many software, like PHP, Apache or other software that built by C:
#define PO_FUNC(bar) bar()
What that means is that whenever you want to call a function, you do it by
PO_FUNC(your_function_name)

Here's an example:
#include <stdio.h>
#define PO_FUNC(bar) bar()

void hello(){
    printf("Hello For All");
}

int main(int argc, char* argv[]){
    PO_FUNC(hello);    // This is the same case as hello()
    return 0;
}
Share/Bookmark

No comments:

Post a Comment