It is partially similar to an Array, but an array holds data of similar type only, but structure can store data of any type.
For example:
If user want to keep record of books in a library.user might want to track the following attributes about each book −
Title
Author
Subject
Book-Id
Syntax Of Structue:
struct[structure tag]
{
//variable1;
//variable2;
//variabl3;
}[structure_variable];
Example:
struct student
{
char name[25];
int age;
char gender;
}s1,s2;
EmoticonEmoticon