home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc / qc25 / employee.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-15  |  544 b   |  31 lines

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