Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void foo(int);
- void testCallback(int, void (*)(int));
- int main(int argc, char **argv){
- testCallback(1000000, &foo);
- printf("[Main function]: I'm main function!\n");
- testCallback(100000, &foo);
- return(0);
- }
- void foo(int num){
- printf("[foo function]: I'm callback!, Parameters[ num=%d ]\n",num);
- }
- void testCallback(int num, void (*callback)(int)){
- int i;
- for(i=0; i < num; i++);
- return(callback(num));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement