Example C Structure

The following shows the result of a C declaration. In this example, the structure was declared without using the Declare The Structure option. Therefore, the structure describes a data type (called dcl_employee), but does not declare it as a variable. In this example, field prefixing has not been used.

struct dcl_employee 
  { 
  short e_no; 
  char lname[11]; 
  char fname[11]; 
  char street[21]; 
  char city[16]; 
  char st[3]; 
  char zip[6]; 
  char dept[5]; 
  double payrate; 
  double com; 
  }; 
  short c_employee_ind[10];

Note that an array called c_employee_ind is also declared after the structure. This array is to be used to hold the null indicators for this table. (for example, c_employee_ind[0] can hold the indicator for e-no, c_employee_ind[1] the indicator for lname, c_employee_ind[2] the indicator for fname, and so forth).