/* --------------------------------------------------------------------------
Name:       structs.c
Function:	Code snippet to illustrate structures
Versions:
   1.0   1/27/2007   L Simone.  Created.  File compiled for debugging mode.
						View memory before and after database entry [0] is 
						stored, and note the byte order and offsets, especially
						the extra (unused) byte after height.  
----------------------------------------------------------------------------- */

/* Structure defining the format and parameters for each patient */
struct patient {
  char ID;        /* subject ID number   */
  char sex;       /* 1=male, 2=female    */
  char height;    /* in cm               */
  int  weight;    /* in pounds           */
  int  maxHR;     /* max HR in beats per minute */
};
/* Database containing space for 5 patients */
struct patient Patient_database[5];
  
void main( void )
{
  Patient_database[0].ID = 1;          /* 0x01       */
  Patient_database[0].sex = 1;         /* 0x01       */
  Patient_database[0].height = 166;    /* 0xA6       */
  Patient_database[0].weight = 300;    /* 0x012C     */
  Patient_database[0].maxHR = 182;     /* 0x00B6     */
}

