struct examples in c
Example 1: declare structure in c
struct num{
int a ;
int b;
};
int main()
{
struct num n;
//accessing the elements inside struct
n.a=10;
n.b=20;
}
Example 2: Structure of Structs in c
The basic structure
struct num{
int a ;
int b;
};
int main()
{
struct num n;
//accessing the elements inside struct
n.a=10;
n.b=20;
}
The basic structure