struct date
{
int day;
int month;
int year;
} dob, doj;
char address[30], dept[30];
};
In this method, you cannot use the structure date directly in other places as an ordinary structure.
On the other hand, if you use the former one where the address structure is declared outside the
structure
Emp
, then you can directly use the address structure in other places also.
A nested structure can also be initialized as follows:
struct Emp emp1 = {“Rajiv”, “Chopra”, 40, 82000.00, 24, 03, 2016, “GTB NAGAR”,
“Computer Science” };
Do'stlaringiz bilan baham: