Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
EMPLOY1.C
◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
/* EMPLOY1.C: Demonstrate structure pointers. */
#include <stdio.h>
struct employee
{
char name[10];
int months;
float wage;
};
void display( struct employee *e_ptr );
main()
{
static struct employee jones =
{
"Jones, J",
77,
13.68
};
display( &jones );
}
void display( struct employee *e_ptr )
{
printf( "Name: %s\n", e_ptr->name );
printf( "Months of service: %d\n", e_ptr->months );
printf( "Hourly wage: %6.2f\n", e_ptr->wage );
}