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

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