Skip to main content

Structures in C Language

           C Language Beginner level
Structure is a collection of different data type values . Structure behaviour is same as an Array but Array is a collection of same data type values .
The syntex of structures can written as -
struct structure_name{
int a, b , c ;
char p , q ;
float r , s ;
} s ;
Note : -
1. struct is the keyword and struct_name shows the name of structure .
To define the variable name and their data type , we use curly braces {} .
2. Inside curly braces , we write all the varaibles , along with their data types .
3. Structure is able to hold different data type values .
4. After closing the curly braces , we can declare a object of this structure , named s .
5. We can declare more than one objects here by separating them with comma like s1 , s2 .
Next>>     <<Back