Created
February 24, 2009 14:36
-
-
Save kamipo/69592 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
#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