Advertisement
Guest User

C89 functional-sucks-language

a guest
Feb 18th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.79 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <locale.h>
  4.  
  5. double(*f)();
  6.    
  7. #define WaitPls sleep(2);
  8.  
  9. void Test() {
  10.     double tmp(){ return 42; };
  11.     printf("tmpAdress: %p\n", tmp);
  12.     printf("tmp = "); printf("%f\n", tmp());
  13.     WaitPls
  14.    
  15.     f = tmp;
  16.     printf("fAdress: %p\n", f);
  17.     printf("f = "); printf("%f\n", f());    
  18.     WaitPls
  19. }
  20.  
  21. int main(void) {
  22.     printf("Test!\n");
  23.     WaitPls
  24.    
  25.     Test();
  26.  
  27.     printf("fArdess_main: %p\n", f);
  28.     printf("f_main = "); printf("%f\n", f());
  29.     WaitPls
  30.    
  31.     printf("Omae wa mou shindeiru\n");
  32.     WaitPls
  33.    
  34.     printf("fArdess_main: %p\n", f);
  35.     WaitPls
  36.    
  37.     printf("NANI?!\n");
  38.     WaitPls
  39.    
  40.     printf("f_main = "); printf("%f\n", f());
  41.    
  42.     WaitPls
  43.     getch();
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement