Advertisement
dllbridge

Untitled

Apr 25th, 2023
875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.63 KB | None | 0 0
  1.  
  2. #include    <stdio.h>
  3. #include   <string.h>
  4.  
  5.  
  6.  
  7.  
  8. int   foo();
  9.  
  10. int  (*nFoo)() = foo;
  11.  
  12.  
  13.  
  14.  
  15. ////////////////////////////////////////////
  16. int main()                                //
  17. {  
  18.     printf("%d\n",  foo);
  19.     printf("%d\n", nFoo);
  20.  
  21. }
  22.  
  23.  
  24.  
  25.  
  26. ////////////////////////////////////////////
  27. int foo()                                 //  
  28. {
  29.    
  30. return 12; 
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. /*
  48.  
  49. #include    <stdio.h>
  50. #include   <string.h>
  51.  
  52.  
  53. char sz[5] = "SONY";
  54.  
  55. int nArr[12];
  56.  
  57. ////////////////////////////////////////////
  58. int main()                                //
  59. {  
  60.  
  61.     memcpy(nArr, sz, 5);
  62.    
  63.     printf("%X\n", nArr[0]);
  64. }
  65.  
  66.  
  67. */
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. /*
  79. #include   <stdio.h>
  80.  
  81.  
  82. #define push(sp, n)     *sp++ = n
  83. #define  pop(sp)      *--sp
  84.  
  85.  
  86. int         stack[1024],                         // Выделяем 4KB  ( 4096 байт памяти или  4 * 1024 ) для нашего стека
  87.       *sp = stack,                                                                     //  Указатель на вершину стека
  88.                 x,                                                                     //           Просто переменная
  89.                 i;                                                                     //          Счётчик для циклов
  90.  
  91.  
  92. ////////////////////////////////////////////
  93. int main()                                //
  94. {  
  95.  
  96.     for(i = 5; i < 25; i ++)  push(sp, i);  
  97.     for(i = 0; i < 20; i ++)
  98.     {    
  99.         x = pop(sp);
  100.    
  101.         printf("x = %d \n", x);
  102.     }  
  103. }
  104.  
  105.  
  106.  
  107.  
  108. */
  109.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement