Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created April 18, 2013 00:54
Show Gist options
  • Save yuuichi-fujioka/5409014 to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/5409014 to your computer and use it in GitHub Desktop.
function pointer example
#include <stdio.h>
typedef void (*FUNC)(const char*);
void printmsg(const char* msg) {
printf("print message is '%s'\n", msg);
}
int main(int argc, char** argv) {
FUNC f = &printmsg;
f("helloworld");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment