Skip to content

Instantly share code, notes, and snippets.

@kamipo
Created February 24, 2009 14:36
Show Gist options
  • Save kamipo/69592 to your computer and use it in GitHub Desktop.
Save kamipo/69592 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int i;
char hello1[255] = "hello1!!\n";
char hello2[255] = "hello2!!\n";
char *func1() { return "func1\n"; }
char *func2() { return "func2\n"; }
char *(*f[])() = { func1, func2 };
char *h[] = { hello1, hello2 };
for (i = 0; i < 2; i++) {
printf("%s", (*f[i])());
}
for (i = 0; i < 2; i++) {
printf("%s", h[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment