SlideShare una empresa de Scribd logo
1 de 15
C structures and unions
C structures: aggregate, yet scalar ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structure declarations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structure declarations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recursively defined structures ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recursively defined structures ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],We can’t initialize the  owner  member at this point, since it hasn’t been declared yet
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Member access .  evaluated first: access  owner  member *  evaluated next: dereference pointer to  HUMAN .  and  ->  have equal precedence and associate left-to-right
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Memory layout id amount num_avail cost currency_type
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Memory layout id amount num_avail cost currency_type
Bit fields ,[object Object],[object Object],[object Object],[object Object],[object Object],ch font size ch font size Note: This won’t work on machines with 16-bit  int s Bit field members must be  int s
Bit fields ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structures as function arguments ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Unions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Unions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Access  type  to determine how to interpret  value
Unions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Más contenido relacionado

La actualidad más candente

User defined data type
User defined data typeUser defined data type
User defined data type
Amit Kapoor
 
Data types in C language
Data types in C languageData types in C language
Data types in C language
kashyap399
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
Manisha Keim
 

La actualidad más candente (19)

data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
User defined data type
User defined data typeUser defined data type
User defined data type
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
 
Data types in C language
Data types in C languageData types in C language
Data types in C language
 
Numerical data.
Numerical data.Numerical data.
Numerical data.
 
Datatypes in c
Datatypes in cDatatypes in c
Datatypes in c
 
Structure in C
Structure in CStructure in C
Structure in C
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 
17 structure-and-union
17 structure-and-union17 structure-and-union
17 structure-and-union
 
C++ data types
C++ data typesC++ data types
C++ data types
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-c
 
Data types
Data typesData types
Data types
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++
 
Data types
Data typesData types
Data types
 
Basic of Structure,Structure members,Accessing Structure member,Nested Struct...
Basic of Structure,Structure members,Accessing Structure member,Nested Struct...Basic of Structure,Structure members,Accessing Structure member,Nested Struct...
Basic of Structure,Structure members,Accessing Structure member,Nested Struct...
 
Lect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer AbbasLect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer Abbas
 
Basic Data Types in C++
Basic Data Types in C++ Basic Data Types in C++
Basic Data Types in C++
 
Enumerated data types in C
Enumerated data types in CEnumerated data types in C
Enumerated data types in C
 
Unit4 C
Unit4 C Unit4 C
Unit4 C
 

Destacado (19)

CNC
CNCCNC
CNC
 
DC Motors
DC MotorsDC Motors
DC Motors
 
Air Pollution
Air PollutionAir Pollution
Air Pollution
 
mrtrology
mrtrologymrtrology
mrtrology
 
NC pogramming
NC pogrammingNC pogramming
NC pogramming
 
welding
weldingwelding
welding
 
Introduction to Concrete
Introduction to ConcreteIntroduction to Concrete
Introduction to Concrete
 
plc introduction
plc introduction plc introduction
plc introduction
 
Bridge
BridgeBridge
Bridge
 
Design of Beam for Shear
Design of Beam for ShearDesign of Beam for Shear
Design of Beam for Shear
 
hydraulics
hydraulicshydraulics
hydraulics
 
Arches
ArchesArches
Arches
 
CNC Machine Maintenance
CNC Machine MaintenanceCNC Machine Maintenance
CNC Machine Maintenance
 
Theodolites
TheodolitesTheodolites
Theodolites
 
footing
footingfooting
footing
 
Introduction to VLSI
Introduction to VLSI Introduction to VLSI
Introduction to VLSI
 
microprocessor
microprocessormicroprocessor
microprocessor
 
Bridge
Bridge Bridge
Bridge
 
Geometric Modeling
Geometric Modeling Geometric Modeling
Geometric Modeling
 

Similar a structures and unions in 'C'

C UNIT-4 PREPARED BY M V BRAHMANANDA RE
C UNIT-4 PREPARED BY M V BRAHMANANDA REC UNIT-4 PREPARED BY M V BRAHMANANDA RE
C UNIT-4 PREPARED BY M V BRAHMANANDA RE
Rajeshkumar Reddy
 
structenumtypedefunion.pptx
structenumtypedefunion.pptxstructenumtypedefunion.pptx
structenumtypedefunion.pptx
KUPPALAPADMINI
 

Similar a structures and unions in 'C' (20)

C Structures And Unions
C  Structures And  UnionsC  Structures And  Unions
C Structures And Unions
 
Unit 1_ADC.pptx
Unit 1_ADC.pptxUnit 1_ADC.pptx
Unit 1_ADC.pptx
 
Chapter4.pptx
Chapter4.pptxChapter4.pptx
Chapter4.pptx
 
C structure and union
C structure and unionC structure and union
C structure and union
 
Structure.pptx
Structure.pptxStructure.pptx
Structure.pptx
 
structures_v1.ppt
structures_v1.pptstructures_v1.ppt
structures_v1.ppt
 
structures_v1.ppt
structures_v1.pptstructures_v1.ppt
structures_v1.ppt
 
Pointers and Structures
Pointers and StructuresPointers and Structures
Pointers and Structures
 
Structure
StructureStructure
Structure
 
C UNIT-4 PREPARED BY M V BRAHMANANDA RE
C UNIT-4 PREPARED BY M V BRAHMANANDA REC UNIT-4 PREPARED BY M V BRAHMANANDA RE
C UNIT-4 PREPARED BY M V BRAHMANANDA RE
 
Lk module4 structures
Lk module4 structuresLk module4 structures
Lk module4 structures
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
 
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 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
 
Structures in c++
Structures in c++Structures in c++
Structures in c++
 
structenumtypedefunion.pptx
structenumtypedefunion.pptxstructenumtypedefunion.pptx
structenumtypedefunion.pptx
 
lec14.pdf
lec14.pdflec14.pdf
lec14.pdf
 
Structure & union
Structure & unionStructure & union
Structure & union
 
Structures in c++
Structures in c++Structures in c++
Structures in c++
 

Más de illpa

Mixing Moulding
Mixing MouldingMixing Moulding
Mixing Moulding
illpa
 
Sand Casting
Sand CastingSand Casting
Sand Casting
illpa
 
Two way slab
Two way slabTwo way slab
Two way slab
illpa
 
limit state method
limit state methodlimit state method
limit state method
illpa
 
Lathe Introduction
Lathe IntroductionLathe Introduction
Lathe Introduction
illpa
 
hydraulics introduction
hydraulics introductionhydraulics introduction
hydraulics introduction
illpa
 
robot
robotrobot
robot
illpa
 

Más de illpa (12)

Arc welding & safty
Arc welding & saftyArc welding & safty
Arc welding & safty
 
Resistance Welding
Resistance WeldingResistance Welding
Resistance Welding
 
Computer Aided Design
Computer Aided DesignComputer Aided Design
Computer Aided Design
 
Fire Safety
Fire SafetyFire Safety
Fire Safety
 
Pumps
PumpsPumps
Pumps
 
Mixing Moulding
Mixing MouldingMixing Moulding
Mixing Moulding
 
Sand Casting
Sand CastingSand Casting
Sand Casting
 
Two way slab
Two way slabTwo way slab
Two way slab
 
limit state method
limit state methodlimit state method
limit state method
 
Lathe Introduction
Lathe IntroductionLathe Introduction
Lathe Introduction
 
hydraulics introduction
hydraulics introductionhydraulics introduction
hydraulics introduction
 
robot
robotrobot
robot
 

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

structures and unions in 'C'