Advertisement
wandrake

Untitled

Nov 12th, 2012
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. const char* seibuonoannulla = "Pappo, sei buono a nulla!";
  4. const char* sonopuggile = "Sono puggile! *PUNCH*";
  5.  
  6. void mamma(void) {
  7.     printf("%s\n", seibuonoannulla);
  8. }
  9.  
  10. void pappo(void) {
  11.     printf("%s\n", sonopuggile);
  12. }
  13.  
  14. void (*funcs[2])(void) = {mamma, pappo};
  15.  
  16. void (*f(int x)) (void) {
  17.     return funcs[x];
  18. }
  19.  
  20. int main(int args, char* argv[]) {
  21.     int i;
  22.    
  23.     for (i = 0; i < 2; i++) {
  24.         f(i)();
  25.     }
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement