Advertisement
dllbridge

Untitled

Apr 7th, 2023
763
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include   <stdio.h>
  2.  
  3.  
  4.        
  5. struct TT
  6. {
  7.    
  8.    int  nInf;
  9.    
  10.    TT *pNext;
  11. };
  12.  
  13.  
  14.  
  15. void foo(TT &);
  16.  
  17.  
  18.  
  19. ////////////////////////////////////////////////////
  20. int main()                                        //
  21. {
  22.     TT a1, a2, a3;
  23.    
  24.     a2.nInf = 7;
  25.  
  26.     foo(a2);    
  27.    
  28. }
  29.  
  30.  
  31. // Требуется распечатать поле nInf для переменной a2 из функции foo().
  32. /////////////////////////////////////////////////////
  33. void foo(TT &x)                                    //  
  34. {
  35.    
  36.    
  37.      printf(" a2.nInf = %d \n",    x.nInf);
  38. }
  39.  
  40.  
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement