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
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: