Advertisement
dllbridge

Untitled

May 22nd, 2024
650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1.  
  2. #include  <stdio.h>
  3. #include <string.h>
  4.  
  5.  
  6. struct People
  7. {
  8.     int        age;
  9.     char  name[29];
  10.     double fWeight;
  11. };
  12.  
  13.  
  14. void  v(People *p);
  15.  
  16.  
  17. /////////////////////////////////////////////////
  18. int main()
  19. {
  20.    
  21.   People people,
  22.           pep_2;
  23.  
  24.  
  25.  
  26.   people.age=15;
  27.  
  28.   strcpy(people.name, "Dima");
  29.  
  30.   people.fWeight = 75.571;
  31.  
  32.   v(&people);
  33. }
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. //////////////////////////////////////////////////
  42. void  v(People *p)
  43. {
  44.    
  45.       printf("name   = %s   \n" ,p->name   );
  46.       printf("age    = %d   \n" ,p->age    );
  47.       printf("Weight = %.3f \n" ,p->fWeight);      
  48. }
  49.  
  50.  
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement