Advertisement
dllbridge

Untitled

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