Structure is a heterogeneous collection of elements referenced by the same name. A structure is declared using the struct keyword. The following is an example that creates a structure to store an employee's information:
struct emp
{
fixed int empID[15];
fixed char name[30];
fixed char addr[50];
fixed char dept[15];
fixed char desig[15];
}
The preceding example defines a structure emp and the members of this structure specify the information of an employee.
No comments:
Post a Comment