home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / R_LA4_01.ZIP / TEAM.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-21  |  1.0 KB  |  36 lines

  1. /****************************************************************/
  2. /* TEAM.C - From page 297 of the book "Microsoft C Program-     */
  3. /* ming for the IBM by Robert Lafore. This is a continuation of */
  4. /* a simple database program developed from page 292 to         */
  5. /* the end of the chapter (9).                                  */
  6. /****************************************************************/
  7.  
  8. struct personnel {
  9.    char name [30];
  10.    int agnumb;
  11. };
  12.  
  13. struct team {
  14.    struct personnel chief;      /*structure within structure*/
  15.    struct personnel indian;
  16. };
  17.  
  18. struct team team1 = {                     /*declares and initializes*/
  19.    { "Harrison Tweedbury", 102 },         /*struct variable team1   */
  20.    { "James Bond", 007         }
  21. };
  22.  
  23. main()
  24. {
  25.  
  26.    printf("\nChief:\n");
  27.    printf("   Name: %s\n", team1.chief.name);
  28.    printf("   Agent number: %03d\n", team1.chief.agnumb);
  29.    printf("\n\nIndian:\n");
  30.    printf("   Name: %s\n", team1.indian.name);
  31.    printf("   Agent number: %03d\n", team1.indian.agnumb);
  32. }
  33.  
  34.  
  35.  
  36.