SlideShare a Scribd company logo
1 of 15
Structures in C
Definition
 Structure is a user-defined data type
in C which allows you to combine
different data types to store a
particular type of record.
 It is somewhat similar to an Array. The
only difference is that array is used to
store collection of similar data types
while structure can store collection of
any type of data.
Example:
Structure is used to represent a record.
 Suppose you want to store record
of Student which consists of student
name, address, roll number and age. You
can define a structure to hold this
information.
 Suppose you want to keep track of your
books in a library. You might want to track
the following attributes about each book −
 Title
 Author
 Subject
 Book ID
Defining a structure
 struct keyword is used to define a structure.
 struct defines a new data type which is a
collection of different types of data.
 Syntax :
 Note: The closing braces in the structure type
declaration must be followed by a
semicolon(;).
Example of Structure
•Here the struct Book declares a structure to hold the
details of book which consists of three data fields,
namely name, price and pages.
•These fields are called structure elements or
members.
•Each member can have different data type,like in this
case, name is of char type and price is of int type etc.
•Book is the name of the structure and is called structure
Declaring Structure Variables
 It is possible to declare variables of
a structure, after the structure is
defined.
 Structure variable declaration is
similar to the declaration of variables
of any other data types.
 Structure variables can be declared in
following two ways.
1) Declaring Structure variables
separately
2) Declaring Structure Variables with
Structure definition
Accessing Structure Members
 Structure members can be accessed
and assigned values in number of ways.
 Structure member has no meaning
independently.
 In order to assign a value to a structure
member, the member name must be
linked with the structure variable using
dot . operator also called period
or member access operator.
We can also use scanf() to give values
to structure members through
terminal.
Structure Initialization
 Like any other data type, structure
variable can also be initialized at
compile time.
Or
Array of Structure
 We can also declare an array of structure.
Each element of the array represents a
structure variable.
 Example : struct employee emp[5];
The below code define an array emp of size 5 elements. Each
element of array emp is of type employee
Nested Structures
 Nesting of structures, is also permitted
in C language.
 Example :
Structure as function arguments
 We can pass a structure as a function
argument in similar way as we pass any other
variable or array.
 Example:

More Related Content

What's hot

Unit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CUnit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CSowmya Jyothi
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programmingprogramming9
 
C Programming: Structure and Union
C Programming: Structure and UnionC Programming: Structure and Union
C Programming: Structure and UnionSelvaraj Seerangan
 
Encapsulation in C++
Encapsulation in C++Encapsulation in C++
Encapsulation in C++Hitesh Kumar
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructorsVineeta Garg
 
1. over view and history of c
1. over view and history of c1. over view and history of c
1. over view and history of cHarish Kumawat
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member FunctionsMOHIT AGARWAL
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programmingHarshita Yadav
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in clavanya marichamy
 
Union In language C
Union In language CUnion In language C
Union In language CRavi Singh
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++Muhammad Waqas
 
Module 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in CModule 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in CTushar B Kute
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1srmohan06
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)indrasir
 

What's hot (20)

C tutorial
C tutorialC tutorial
C tutorial
 
Data types vbnet
Data types vbnetData types vbnet
Data types vbnet
 
Unit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in CUnit ii chapter 2 Decision making and Branching in C
Unit ii chapter 2 Decision making and Branching in C
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
C Programming: Structure and Union
C Programming: Structure and UnionC Programming: Structure and Union
C Programming: Structure and Union
 
Encapsulation in C++
Encapsulation in C++Encapsulation in C++
Encapsulation in C++
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 
1. over view and history of c
1. over view and history of c1. over view and history of c
1. over view and history of c
 
Static Data Members and Member Functions
Static Data Members and Member FunctionsStatic Data Members and Member Functions
Static Data Members and Member Functions
 
data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Differences between c and c++
Differences between c and c++Differences between c and c++
Differences between c and c++
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in c
 
Union In language C
Union In language CUnion In language C
Union In language C
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
Object Oriented Programming Using C++
Object Oriented Programming Using C++Object Oriented Programming Using C++
Object Oriented Programming Using C++
 
Module 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in CModule 05 Preprocessor and Macros in C
Module 05 Preprocessor and Macros in C
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
 
Datatypes in c
Datatypes in cDatatypes in c
Datatypes in c
 
C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)C basics 4 std11(GujBoard)
C basics 4 std11(GujBoard)
 
Enums in c
Enums in cEnums in c
Enums in c
 

Similar to Structures in c language

Structure prespentation
Structure prespentation Structure prespentation
Structure prespentation ashu awais
 
structure and union1.pdf
structure and union1.pdfstructure and union1.pdf
structure and union1.pdfHMCollegeInfo
 
Structures in c++
Structures in c++Structures in c++
Structures in c++Swarup Boro
 
C programing -Structure
C programing -StructureC programing -Structure
C programing -Structureshaibal sharif
 
CPU : Structures And Unions
CPU : Structures And UnionsCPU : Structures And Unions
CPU : Structures And UnionsDhrumil Patel
 
C Structures and Unions
C Structures and UnionsC Structures and Unions
C Structures and UnionsDhrumil Patel
 
Structure in c language
Structure in c languageStructure in c language
Structure in c languagesangrampatil81
 
Lk module4 structures
Lk module4 structuresLk module4 structures
Lk module4 structuresKrishna Nanda
 
Chapter 13.1.9
Chapter 13.1.9Chapter 13.1.9
Chapter 13.1.9patcha535
 
2 lesson 2 object oriented programming in c++
2 lesson 2 object oriented programming in c++2 lesson 2 object oriented programming in c++
2 lesson 2 object oriented programming in c++Jeff TUYISHIME
 
oop Lecture 1
oop Lecture 1oop Lecture 1
oop Lecture 1Atif Khan
 
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdfSTRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdfSowmyaJyothi3
 
Definition, Declaration of Structures in C.pptx
Definition, Declaration of Structures in C.pptxDefinition, Declaration of Structures in C.pptx
Definition, Declaration of Structures in C.pptxAnithaTAssistantProf
 
Str
StrStr
StrAcad
 

Similar to Structures in c language (20)

Structure prespentation
Structure prespentation Structure prespentation
Structure prespentation
 
structure and union1.pdf
structure and union1.pdfstructure and union1.pdf
structure and union1.pdf
 
Structures in c++
Structures in c++Structures in c++
Structures in c++
 
C programing -Structure
C programing -StructureC programing -Structure
C programing -Structure
 
Structures in c++
Structures in c++Structures in c++
Structures in c++
 
CPU : Structures And Unions
CPU : Structures And UnionsCPU : Structures And Unions
CPU : Structures And Unions
 
C Structures and Unions
C Structures and UnionsC Structures and Unions
C Structures and Unions
 
Structure in c language
Structure in c languageStructure in c language
Structure in c language
 
Lk module4 structures
Lk module4 structuresLk module4 structures
Lk module4 structures
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Chapter 13.1.9
Chapter 13.1.9Chapter 13.1.9
Chapter 13.1.9
 
Unit 4 qba
Unit 4 qbaUnit 4 qba
Unit 4 qba
 
Structure.pptx
Structure.pptxStructure.pptx
Structure.pptx
 
2 lesson 2 object oriented programming in c++
2 lesson 2 object oriented programming in c++2 lesson 2 object oriented programming in c++
2 lesson 2 object oriented programming in c++
 
oop Lecture 1
oop Lecture 1oop Lecture 1
oop Lecture 1
 
Unit-V.pptx
Unit-V.pptxUnit-V.pptx
Unit-V.pptx
 
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdfSTRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
 
Definition, Declaration of Structures in C.pptx
Definition, Declaration of Structures in C.pptxDefinition, Declaration of Structures in C.pptx
Definition, Declaration of Structures in C.pptx
 
Str
StrStr
Str
 
Structure & union
Structure & unionStructure & union
Structure & union
 

More from Tanmay Modi

Preprocessor directives in c laguage
Preprocessor directives in c laguagePreprocessor directives in c laguage
Preprocessor directives in c laguageTanmay Modi
 
Loops in c language
Loops in c languageLoops in c language
Loops in c languageTanmay Modi
 
Generations of computers
Generations of computersGenerations of computers
Generations of computersTanmay Modi
 
Storage classes in c language
Storage classes in c languageStorage classes in c language
Storage classes in c languageTanmay Modi
 
Union in c language
Union in c languageUnion in c language
Union in c languageTanmay Modi
 
Operators inc c language
Operators inc c languageOperators inc c language
Operators inc c languageTanmay Modi
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c languageTanmay Modi
 
Dynamic memory allocation in c language
Dynamic memory allocation in c languageDynamic memory allocation in c language
Dynamic memory allocation in c languageTanmay Modi
 
Decision statements in c laguage
Decision statements in c laguageDecision statements in c laguage
Decision statements in c laguageTanmay Modi
 
Arrays in c v1 09102017
Arrays in c v1 09102017Arrays in c v1 09102017
Arrays in c v1 09102017Tanmay Modi
 

More from Tanmay Modi (11)

Preprocessor directives in c laguage
Preprocessor directives in c laguagePreprocessor directives in c laguage
Preprocessor directives in c laguage
 
Loops in c language
Loops in c languageLoops in c language
Loops in c language
 
Generations of computers
Generations of computersGenerations of computers
Generations of computers
 
Storage classes in c language
Storage classes in c languageStorage classes in c language
Storage classes in c language
 
Union in c language
Union in c languageUnion in c language
Union in c language
 
Operators inc c language
Operators inc c languageOperators inc c language
Operators inc c language
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c language
 
Dynamic memory allocation in c language
Dynamic memory allocation in c languageDynamic memory allocation in c language
Dynamic memory allocation in c language
 
Decision statements in c laguage
Decision statements in c laguageDecision statements in c laguage
Decision statements in c laguage
 
Arrays in c v1 09102017
Arrays in c v1 09102017Arrays in c v1 09102017
Arrays in c v1 09102017
 
Cryptocurrency
Cryptocurrency Cryptocurrency
Cryptocurrency
 

Recently uploaded

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

Structures in c language

  • 2. Definition  Structure is a user-defined data type in C which allows you to combine different data types to store a particular type of record.  It is somewhat similar to an Array. The only difference is that array is used to store collection of similar data types while structure can store collection of any type of data.
  • 3. Example: Structure is used to represent a record.  Suppose you want to store record of Student which consists of student name, address, roll number and age. You can define a structure to hold this information.  Suppose you want to keep track of your books in a library. You might want to track the following attributes about each book −  Title  Author  Subject  Book ID
  • 4. Defining a structure  struct keyword is used to define a structure.  struct defines a new data type which is a collection of different types of data.  Syntax :  Note: The closing braces in the structure type declaration must be followed by a semicolon(;).
  • 5. Example of Structure •Here the struct Book declares a structure to hold the details of book which consists of three data fields, namely name, price and pages. •These fields are called structure elements or members. •Each member can have different data type,like in this case, name is of char type and price is of int type etc. •Book is the name of the structure and is called structure
  • 6. Declaring Structure Variables  It is possible to declare variables of a structure, after the structure is defined.  Structure variable declaration is similar to the declaration of variables of any other data types.  Structure variables can be declared in following two ways.
  • 7. 1) Declaring Structure variables separately
  • 8. 2) Declaring Structure Variables with Structure definition
  • 9. Accessing Structure Members  Structure members can be accessed and assigned values in number of ways.  Structure member has no meaning independently.  In order to assign a value to a structure member, the member name must be linked with the structure variable using dot . operator also called period or member access operator.
  • 10. We can also use scanf() to give values to structure members through terminal.
  • 11. Structure Initialization  Like any other data type, structure variable can also be initialized at compile time. Or
  • 12. Array of Structure  We can also declare an array of structure. Each element of the array represents a structure variable.  Example : struct employee emp[5];
  • 13. The below code define an array emp of size 5 elements. Each element of array emp is of type employee
  • 14. Nested Structures  Nesting of structures, is also permitted in C language.  Example :
  • 15. Structure as function arguments  We can pass a structure as a function argument in similar way as we pass any other variable or array.  Example: