home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / c / other / learn / employee.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-07  |  546 b   |  32 lines

  1. /* EMPLOYEE.C: Demonstrate structures. */
  2.  
  3. #include <stdio.h>
  4. #include <string.h>
  5.  
  6. struct employee
  7. {
  8.    char name[10];
  9.    int months;
  10.    float wage;
  11. };
  12.  
  13. void display( struct employee show );
  14.  
  15. main()
  16. {
  17.    struct employee jones;
  18.  
  19.    strcpy( jones.name, "Jones, J" );
  20.    jones.months = 77;
  21.    jones.wage = 13.68;
  22.  
  23.    display( jones );
  24. }
  25.  
  26. void display( struct employee show )
  27. {
  28.    printf( "Name: %s\n", show.name );
  29.    printf( "Months of service: %d\n", show.months );
  30.    printf( "Hourly wage: %6.2f\n", show.wage );
  31. }
  32.