Advertisement
dllbridge

Untitled

Oct 30th, 2023
849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.03 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include   <stdio.h>
  5.  
  6.  
  7.  
  8. int foo(int);
  9.  
  10. int (*pf)(int) = foo;
  11.  
  12. ////////////////////////////////////////////////////   unsigned
  13. int main()                                        //
  14. {
  15.    
  16.     printf("foo address = %d\n"  , foo);
  17.     printf("pf  address = %d\n"  ,  pf);
  18.     foo(101);
  19.     pf (333);
  20.    
  21. }
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. /////////////////////////////////////////////////////
  29. int foo(int n)
  30. {
  31.    
  32.     printf("n = %d\n"  , n);
  33.        
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. /*
  59.  
  60. #include   <stdio.h>
  61.  
  62. int n = 889;
  63.  
  64. int &a = n;
  65.  
  66.  
  67. ////////////////////////////////////////////////////   unsigned
  68. int main()                                        //
  69. {
  70.    
  71.     printf("n address = %d\n", &n);
  72.     printf("a address = %d\n", &a);
  73.    
  74. }
  75.  
  76.  
  77.  
  78.  
  79. */
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107. /*
  108.  
  109. #include   <stdio.h>
  110.  
  111.  
  112. namespace Dima
  113. {
  114.     int n = 9;
  115. }
  116.  
  117. using namespace Dima;
  118.  
  119. int j = 14;
  120.  
  121.  
  122. ////////////////////////////////////////////////////   unsigned
  123. int main()                                        //
  124. {
  125.    
  126.  
  127.     printf("%d\n", Dima::n);
  128.  
  129. }
  130.  
  131.  
  132.  
  133. */
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159. /*
  160.  
  161. #include   <stdio.h>
  162.  
  163.  
  164. void foo();
  165.  
  166. ////////////////////////////////////////////////////   unsigned
  167. int main()                                        //
  168. {
  169.    
  170.  
  171.      
  172.    foo();
  173.    foo();
  174. }
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185. /////////////////////////////////////////////////////
  186. void foo()
  187. {
  188.    
  189.     static int n = 9;
  190.    
  191.    
  192.     printf("%d\n", n);
  193.  
  194.     n += 7;
  195. }
  196.  
  197.  
  198. */
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212. /*
  213.  
  214. #include   <stdio.h>
  215.  
  216.  
  217. void foo(int *pjkhkjhkjhkj);
  218.  
  219. ////////////////////////////////////////////////////   unsigned
  220. int main()                                        //
  221. {
  222.    
  223.    
  224.    int nArr[33];
  225.    
  226.    for(int i = 0; i < 31; i++)
  227.    {
  228.            
  229.        nArr[i] = i;    
  230.    }  
  231.    
  232.    
  233.      
  234.    foo( &nArr[0] );
  235.  
  236. }
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247. /////////////////////////////////////////////////////
  248. void foo(int *p)
  249. {
  250.    
  251.      for(int i = 0; i < 7; i++)
  252.      {
  253.            
  254.        printf("%d\n", p[-i]);      
  255.      }
  256. }
  257.  
  258.  
  259.  
  260. */
  261.  
  262.  
  263.  
  264.  
  265.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement