KEMBAR78
Nested structure (Computer programming and utilization) | PPTX
NESTED STRUCTURE
Nested structure in C is nothing but structure within structure.
One structure can be declared inside other structure as we declare
structure members inside a structure.
The structure variable can be normal structure variable.
#include<stdio.h>
#include<string.h>
struct address
{
char phone [15];
char city [15];
int pin;
} a1;
struct emp
{
char name [15];
int emp_no;
float salary;
}e1;
void main()
{
{
struct address a1;
a1.phone=8140733161;
a1.city=“hansot”;
a1.pin_no.=393030;
}
{
struct emp e1;
e1.name=“Prakash”;
e1.emp_no=2016;
e1.salary=15,500;
}
Printf(“%s”,a1.phone);
Printf(“%s”,a1.city);
Printf(“%d”,a1.pin);
Printf(“%s”,e1.name);
Printf(“%d”,e1.emp_no);
Printf(“%f”,e1.salary);
}

Nested structure (Computer programming and utilization)