STRUCTURES WITH IN STRUCTURES:
Structures with in structures means nesting of structures.
struct
salary
{
char name[10];
char dept[10];
int basic;
int da;
int hra;
int city_allowance;
} employee;
This structure defines name,
department, basic and three kinds of allowances together and declares them
under a sub-structure as shown below.
struct allow
{
int da;
int hra;
int city;
}
|
struct
employee
{
char
name[20];
char
dept[10];
struct
allow_salary;
};
struct employee
emp;
No comments:
Post a Comment