Advertisement
dllbridge

Untitled

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