Advertisement
dllbridge

Untitled

Feb 20th, 2023
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.94 KB | None | 0 0
  1.  
  2.  
  3. #include <stdio.h>
  4.  
  5.  
  6.  
  7.  
  8.  
  9. void foo(int *p);
  10.  
  11.  
  12. ///////////////////////////////////////////////////////
  13. int main()
  14. {
  15.  
  16.     int nArr[19] =  { 17, 5, 0, 777, 11, -2, 198, -3, 7, 3 };  
  17.  
  18.     foo(&nArr[-7]);
  19.    
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
  26. ////////////////////////////////////////////////////////
  27. void foo(int *p)
  28. {
  29.    
  30.     for(int i = 0; i < 10; i++)
  31.     {
  32.        
  33.         printf(" arr[%d] = %3d \n", i, p[i]);
  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.  
  63. int  nMin =  12;
  64. int *p    = &nMin;
  65.  
  66. ///////////////////////////////////////////////////////
  67. int main()
  68. {
  69.  
  70.    
  71.     printf(" nMin = %d\n",nMin);
  72.     printf("    p = %d\n",p);  
  73.     printf("&nMin = %d\n",&nMin);
  74.     printf("   *p = %d\n",*p);     
  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. #include <stdio.h>
  107.  
  108.  
  109. int n = 12;
  110.  
  111. ///////////////////////////////////////////////////////
  112. int main()
  113. {
  114.  
  115.     int n = 77;
  116.    
  117.     printf("n = %d\n", ::n);
  118. }
  119.  
  120.  
  121.  
  122. */
  123.  
  124.  
  125.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement