Advertisement
dllbridge

Untitled

Jan 11th, 2024
780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.13 KB | None | 0 0
  1.  
  2.  
  3. /*
  4.  
  5. #include   <stdio.h>
  6.  
  7. int  n = 912,
  8.     *p =  &n,
  9.     &r =   n;
  10.  
  11.  
  12. ///////////////////////////////////////////////////////////
  13. int main()
  14. {
  15.    
  16.    
  17.                
  18.     printf("addres of n = %d\n", &n);  
  19.     printf("addres of n = %d\n",  p);
  20.     printf("          n = %d\n", *p);    
  21.     printf("addres of p = %d\n", &p);  
  22.    
  23.     printf("  Size of n = %d\n", sizeof(int) );    
  24.     printf("addres of r = %d\n", &r);
  25.  
  26. return 0;
  27. }
  28.  
  29.  
  30.  
  31. */
  32.  
  33.  
  34. /*
  35. #include   <stdio.h>
  36.  
  37. int  n  = 912,
  38.     *p  =  &n,
  39.     &r  =   n,
  40.    **p2 =  &p;
  41.  
  42.  
  43. ///////////////////////////////////////////////////////////
  44. int main()
  45. {
  46.    
  47.    
  48.                
  49.     printf("n  = %d\n", *(*p2));    
  50.    
  51.    
  52. }
  53.  
  54. */
  55.  
  56.  
  57.  
  58.  
  59.  
  60. #include   <stdio.h>
  61.  
  62.  
  63. void foo(int *);
  64.  
  65.  
  66. ///////////////////////////////////////////////////////////
  67. int main()
  68. {
  69.    
  70.     int  nArr[11]  = {0, 27, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  71.    
  72.    
  73.     foo(&nArr[3]);
  74.      
  75. }
  76.  
  77.  
  78.  
  79.  
  80. ///////////////////////////////////////////////////////////
  81. void foo(int *p)
  82. {
  83.     for(int i = 0; i < 11; i = i + 1)
  84.     {
  85.        printf("nArr[i]  = %d\n", p[ i ] );     
  86.     }  
  87. }
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement