Skip to content

Instantly share code, notes, and snippets.

@steakunderscore
Created June 24, 2011 11:19
Show Gist options
  • Save steakunderscore/1044594 to your computer and use it in GitHub Desktop.
Save steakunderscore/1044594 to your computer and use it in GitHub Desktop.
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