SlideShare ist ein Scribd-Unternehmen logo
1 von 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]

Weitere ähnliche Inhalte

Was ist angesagt?

data types in C programming
data types in C programmingdata types in C programming
data types in C programmingHarshita Yadav
 
User defined data type
User defined data typeUser defined data type
User defined data typeAmit Kapoor
 
Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Typesk v
 
Data types in C language
Data types in C languageData types in C language
Data types in C languagekashyap399
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data typesManisha Keim
 
3 data-types-in-c
3 data-types-in-c3 data-types-in-c
3 data-types-in-cteach4uin
 
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++Neeru Mittal
 
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...Smit Shah
 
Basic Data Types in C++
Basic Data Types in C++ Basic Data Types in C++
Basic Data Types in C++ Hridoy Bepari
 
Enumerated data types in C
Enumerated data types in CEnumerated data types in C
Enumerated data types in CArpana shree
 

Was ist angesagt? (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
 

Andere mochten auch

DC Motors
DC MotorsDC Motors
DC Motorsillpa
 
Air Pollution
Air PollutionAir Pollution
Air Pollutionillpa
 
mrtrology
mrtrologymrtrology
mrtrologyillpa
 
NC pogramming
NC pogrammingNC pogramming
NC pogrammingillpa
 
welding
weldingwelding
weldingillpa
 
Introduction to Concrete
Introduction to ConcreteIntroduction to Concrete
Introduction to Concreteillpa
 
plc introduction
plc introduction plc introduction
plc introduction illpa
 
Bridge
BridgeBridge
Bridgeillpa
 
Design of Beam for Shear
Design of Beam for ShearDesign of Beam for Shear
Design of Beam for Shearillpa
 
hydraulics
hydraulicshydraulics
hydraulicsillpa
 
Arches
ArchesArches
Archesillpa
 
CNC Machine Maintenance
CNC Machine MaintenanceCNC Machine Maintenance
CNC Machine Maintenanceillpa
 
Theodolites
TheodolitesTheodolites
Theodolitesillpa
 
footing
footingfooting
footingillpa
 
Introduction to VLSI
Introduction to VLSI Introduction to VLSI
Introduction to VLSI illpa
 
microprocessor
microprocessormicroprocessor
microprocessorillpa
 
Bridge
Bridge Bridge
Bridge illpa
 
Geometric Modeling
Geometric Modeling Geometric Modeling
Geometric Modeling illpa
 

Andere mochten auch (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
 

Ähnlich wie structures and unions in 'C'

Ähnlich wie 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++
 

Mehr von illpa

Arc welding & safty
Arc welding & saftyArc welding & safty
Arc welding & saftyillpa
 
Resistance Welding
Resistance WeldingResistance Welding
Resistance Weldingillpa
 
Computer Aided Design
Computer Aided DesignComputer Aided Design
Computer Aided Designillpa
 
Fire Safety
Fire SafetyFire Safety
Fire Safetyillpa
 
Pumps
PumpsPumps
Pumpsillpa
 
Mixing Moulding
Mixing MouldingMixing Moulding
Mixing Mouldingillpa
 
Sand Casting
Sand CastingSand Casting
Sand Castingillpa
 
Two way slab
Two way slabTwo way slab
Two way slabillpa
 
limit state method
limit state methodlimit state method
limit state methodillpa
 
Lathe Introduction
Lathe IntroductionLathe Introduction
Lathe Introductionillpa
 
hydraulics introduction
hydraulics introductionhydraulics introduction
hydraulics introductionillpa
 
robot
robotrobot
robotillpa
 

Mehr von 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
 

Kürzlich hochgeladen

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 functionsKarakKing
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
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Ữ Â...Nguyen Thanh Tu Collection
 
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.pdfNirmal Dwivedi
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
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)Jisc
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
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.docxRamakrishna Reddy Bijjam
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
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...Poonam Aher Patil
 

Kürzlich hochgeladen (20)

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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
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Ữ Â...
 
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
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
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)
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
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
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
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...
 

structures and unions in 'C'