struct <structure-tag>
{
list of members
< member variable 3>
} <structure-variable-name1>,<sttructure-variable-name2>;
1.struct:
It is the reserved or keyword used in structure definition.
- <structure-tag>:
It is the name given by the programmer and used to identity the structure in future re-definitions. They are used to declare structure variables.
- :
Any valid data type in ‘C’.
- < member variable 1…4>:
are names of the variables.
- <structure-variable-name 1,.2>:
It is used to access the members of the structure. Example:
struct student
{
int SP regno;
char name[20];
char class[5];
char combination[4];
float fees;
} st1, st2, st3;