Structure: -
As we know that an array is the collection of same data type but structure is the collection of different data types or different variables or different field.
A structure is written as:
Struct name of structure
{
Type member’s variables;
};
Where the word struct is used for structure and it is a reserved word, which tells the compiler that we are introducing the structure and fields.
For example
Struct student record
{
Char name [15];
Char exam [10];
Int phy, che, math’s;
};
So the student name is the name of structure and name, exam are the fields of character type and phy, che, math’s are the fields of integer type.
Posted by: Wasim Javed
No comments:
Post a Comment