8.derived data types

guptahardik05 626 views 5 slides May 31, 2014
Slide 1
Slide 1 of 5
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5

About This Presentation

No description available for this slideshow.


Slide Content

Derived Data Types What you’ll learn: What are derived data types Structures Unions Enumerations

What are Derived Data types ? These are composed of more than one type of data. We have already covered array and strings. More derived data types: Structures Unions Enumerations

Structure Structure can contain more than one type of data. Syntax: struct tag_name { Data_type_1 variable_name ; ….. Data_type_n variable_name ; } Struct tag_name variable_list ; (Note: Variable list is of type struct )

Union Special data type that enables us to store different types of data in the same memory location, i.e. memory is shared between these variables. Only one member occupies memory at a given time. Efficient way of using same memory location. Prevents memory fragmentation.

Enumeration Consists of a set of named integer constants. Syntax: enum tag_name { …… enum -list------ }
Tags