Advertisement
dllbridge

Untitled

Jan 16th, 2025
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.84 KB | None | 0 0
  1.  
  2. #include   <stdio.h>
  3. #include  <string.h>
  4.  
  5. /////////////////////////////////////////////
  6. struct T
  7. {
  8.  
  9.     int n;
  10.        
  11.     float f;  
  12.    
  13.     double fMassa;
  14.    
  15.     char szName[99];
  16. };
  17.  
  18.  
  19.  
  20. void monitof(T *p);
  21.  
  22. ////////////////////////////////////////////////////////////////////////////////////
  23. int main()
  24. {
  25.    
  26.     T t1, t2, tArr[99];
  27.    
  28.    
  29.     t1.n =   12;
  30.     t1.f = 1.57;
  31.     strcpy(t1.szName, "Dima");
  32.    
  33.    
  34.     t2.n =   11;
  35.     t2.f = 1.41;    
  36.     strcpy(t2.szName, "Olga");    
  37.     monitof(&t1);
  38.     monitof(&t2);    
  39.  
  40. }
  41.  
  42.  
  43.  
  44.  
  45.  
  46. //////////////////////////////////////////////////////////////
  47. void monitof(T *p)
  48. {
  49.     printf("age   = %4d\n",  (*p).n);
  50.  
  51.     printf("Hight = %.2f\n",  p->f );
  52.  
  53.     printf("Name  =   %s\n",  p->szName );
  54.        
  55.     printf("- - - - - - - - - - \n");
  56. }
  57.  
  58.  
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement