Created
June 24, 2011 11:19
-
-
Save steakunderscore/1044594 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From http://www.cprogramming.com/tutorial/function-pointers.html | |
#include <stdio.h> | |
void my_int_func(int x) | |
{ | |
printf( "%d\n", x ); | |
} | |
int main() | |
{ | |
void (*foo)(int); | |
/* the ampersand is actually optional */ | |
foo = &my_int_func; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment