Advertisement
dllbridge

Untitled

Aug 2nd, 2024
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1.  
  2.  
  3. #include <stdio.h>
  4.  
  5.  
  6. int nArr[10] = {44, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  7.  
  8. //////////////////////////////////////////////////////////
  9. int main()
  10. {
  11.    
  12.     int *p = &nArr[4];
  13.    
  14.    
  15.     printf("&nArr[4] = %d \n",  p      );
  16.     printf("&nArr[4] = %d \n", &nArr[4]);  
  17.     printf("&nArr[5] = %d \n", &nArr[5]);  
  18.     printf("&nArr[5] = %d \n",  p + 1  );  
  19.     printf("&nArr[5] = %d \n", &p[1]    );     
  20.     printf(" nArr[5] = %d \n",  p[1]    );     
  21. }
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. /*
  49. #include <stdio.h>
  50.  
  51.  
  52. int n = 44;
  53.  
  54. //////////////////////////////////////////////////////////
  55. int main()
  56. {
  57.    
  58.     printf("address of n = %d \n", &n);
  59.    
  60.     int *p = &n;
  61.    
  62.     printf("address of n = %d \n",  p);
  63.     printf("address of p = %d \n", &p);
  64. }
  65.  
  66.  
  67. */
  68.  
  69.  
  70.  
  71.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement