Advertisement
dllbridge

Untitled

Sep 16th, 2024
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1.  
  2.  
  3. #include<stdio.h>
  4.  
  5. void foo(int *p);
  6.  
  7. int main()
  8. {
  9.     int nArr[10] = { 14,15,16,17,18,19,20,21,22,23 };
  10.    
  11.    
  12.     int *p = &nArr[3];
  13.     printf(" number massiva nArr=   %d\n", *p);
  14.     printf("address= %d\n", p);
  15.    
  16.     foo(nArr);
  17.  
  18. }
  19.  
  20.  
  21. /////////////////////////////////////////////////////
  22. void foo(int *p)
  23. {
  24.      
  25.      for(int i = 0; i < 10; i++)
  26.      {
  27.              
  28.         if(p[i] == 17)
  29.         {
  30.            printf("      i = %d\n", i    );
  31.            printf("address = %d\n", &p[i]);    
  32.                
  33.         }        
  34.      }
  35.      
  36. }
  37.  
  38.  
  39.  
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement