Advertisement
dllbridge

Untitled

Feb 16th, 2022
956
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.37 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include    <stdio.h>
  5. #include   <string.h>
  6.  
  7.  
  8.  
  9. struct EEE
  10. {
  11.    
  12.      char    szName[99];
  13.      
  14.      int           nOld;   
  15.      
  16.      char szTelNumb[24];
  17.      
  18.      EEE(){
  19.            
  20.         strcpy(szName,       "None");    
  21.         nOld = -1;    
  22.         strcpy(szTelNumb, "Not set");          
  23.      }
  24.    
  25. } ;
  26.  
  27. void print_man(EEE *);
  28.  
  29. ////////////////////////////////////////////////////
  30. int main()                                        //
  31. {
  32.     EEE e[500];
  33.    
  34.     int select;
  35.    
  36.     strcpy(e[1].szName,               "Efim");    
  37.     e[1].nOld = 12;    
  38.     strcpy(e[1].szTelNumb, "+7-911-455-1945");    
  39.     strcpy(e[2].szName,               "Ilya");    
  40.     e[2].nOld =  9;    
  41.     strcpy(e[2].szTelNumb, "+7-953-566-46-14");
  42.     strcpy(e[21].szName,    "Kozlova Natalia");    
  43.     e[21].nOld =  50;    
  44.     strcpy(e[21].szTelNumb, "+7-000-222-11-11");
  45.    
  46.     printf(" 1: %s \n", e[ 1].szName);  
  47.     printf(" 2: %s \n", e[ 2].szName);  
  48.     printf("21: %s \n", e[21].szName);
  49.     printf("For more information, select the person's number: ");          
  50.     scanf("%d", &select);
  51.    
  52.     print_man(&e[select]);
  53. }
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. /////////////////////////////////////////////////////
  61. void print_man(EEE *p)
  62. {
  63.    
  64.      printf(" His name = %s \n", p->   szName);
  65.      printf("      Age = %d \n", p->   nOld  );
  66.      printf("Telephone:  %s \n", p->szTelNumb);
  67.      printf(" - - - - - - - - - - - - - \n");          
  68. }
  69.  
  70.  
  71.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement