Nested structure (Computer programming and utilization)

Digvijaysinhgohil 1,685 views 4 slides Oct 16, 2017
Slide 1
Slide 1 of 4
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4

About This Presentation

Computer programming and utilization


Slide Content

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); }
Tags