How Structures are initialized?
A structure can be initialized at design time as follows:
Example :
struct student
{
int roll_no;
int age;
char name[20];
};
struct student stu = {1,17,"Mukesh"};
What are nested structures?
A structure built within another structure is called as nested structure.
Example :
struct dob
{
int day;
int month;
int year;
};
struct student
{
int roll_no;
char name[20];
struct dob date; // structure with in a structure
}stu;
What is meant by an array of structures?
An array of structures contains data elements of every structure variable stored in to an array.
Example :
struct student
{
int reg no;
int age;
char name[20];
}stu[10];
Thanks
Mukesh Rajput
Post A Comment:
0 comments: