Advertisement
dllbridge

Untitled

Jul 26th, 2024
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include  <stdio.h>
  2.  
  3.  
  4.  
  5.  
  6. /////////////////////////////////////////
  7. void foo(char *p)                      //
  8. {
  9.      printf("address of nArr[4] = %d\n",  p);
  10.      printf("address of nArr[3] = %d\n", &p[-1]);  
  11.      printf(" - - - - - - - -\n");  
  12. }
  13.  
  14.  
  15. /////////////////////////////////////////
  16. int main()                             //
  17. {
  18.    
  19.     char nArr[5] = "SONY";
  20.    
  21.     foo(&nArr[2]);
  22.    
  23.  
  24.      printf("address of nArr[4] = %d\n",  &nArr[4]);
  25.      printf("address of nArr[3] = %d\n",  &nArr[3]);  
  26. }
  27.  
  28.  
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement