SlideShare a Scribd company logo
CONCEPT OF  C++ DATA TYPESMADE BY:-                                   RAFIYA SIRINXI-B
DATA TYPESData types are means to identify the type of data and associated operations of handling it. C++ provides a predefined set of data types for handling the data it uses. When variables are declared of a particular data type then the variable becomes the place where the data is stored and data types is the type of value(data) stored by that variable. Data can be of may types such as character, integer, real etc. since the data to be dealt with are of may types, a programming language must provide different data types.
FUNDAMENTAL DATA TYPESDATA TYPE MODIFIERSDATA TYPESDERIVED DATA TYPESUSER  DEFINED DATA TYPES
INTEGERCHARACTERFUNDAMENTAL DATA TYPESFLOATFUNDAMENTAL DATA TYPES ARE THOSE THAT ARE NOT COMPOSED OF OTHER DATA TYPESDOUBLEVOID
INTEGER DATA TYPEIntegers are whole numbers with a machine dependent range of values. A good programming language as to support the programmer by giving a control on a range of numbers and storage space. C has 3 classes of integer storage namely short int, int and long int. All of these data types have signed and unsigned forms. A short int requires half the space than normal integer values. Unsigned numbers are always positive and consume all the bits for the magnitude of the number. The long and unsigned integers are used to declare a longer range of values.
CHARACTER DATA TYPEIt can store any member of the C++ implementation's basic character set. If a character from this set is stored in a character variable, its value is equivalent to the integer code of that character. Character data type is often called as integer data type because the memory implementation of char data type is in terms of the number code.
FLOAT DATA TYPEA number having fractional part is a floating- point number. An identifier declared as float becomes a floating-point variable and can hold floating-point numbers. floating point variables represent real numbers. They have two advantages over integer data types:-1: they can represent values between integers.2: they can represent a much greater range of values.they have one disadvantage also, that is their operations are usually slower.
The data type double is also used for handling floating-point numbers. But it is treated as a distinct data type because, it occupies twice as much memory as type float, and stores floating-point numbers with much larger range and precision. It is slower that type float.DOUBLE DATA TYPE
VOID DATA TYPEIt specifies an empty set of values. It is used as the return type for functions that do not return a value. No object of type void may be declared. It is used when program or calculation does not require any value but the syntax needs it.
INTEGER TYPE MODIFIERSDATA TYPE MODIFIERSCHARACTER TYPEMODIFIERSTHEY CHANGE SOME PROPERTIES OF THE DATA TYPEFLOATING-POINT MODIFIERS
INTEGER TYPE MODIFIERSC++ offers three types of integer data type:-1:-  short integer- at least two bytes.2:-  int integer – at least as big as short.3:- long integer-at least four bytes.  the prefix signed makes the integer type hold negative values also. Unsigned makes the integer not to hold negative values.
Concept Of C++ Data Types
CHARACTER TYPE MODIFIERThe char can also be signed or unsigned. unlike int,char is not signed or unsigned by default. It is later modified to best fit the type to the hardware properties.
FLOATING POINT TYPE MODIFIERSThere are three floating-point types: float, double, and long double. These types represent minimum allowable range of types.Note:- don’t use commas in numeric values assigned to variables.
Concept Of C++ Data Types
ARRAYSFUNCTIONSDERIVED DATA TYPESPOINTERSREFERENCESCONSTANTS
ARRAYSAn array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier.That means that, for example, we can store 5 values of type int in an array without having to declare 5 different variables, each one with a different identifier. Instead of that, using an array we can store 5 different values of the same type, int for example, with a unique identifier.Like a regular variable, an array must be declared before it is used. A typical declaration for an array in C++ is:type name [elements];NOTE: The elements field within brackets [ ] which represents the number of elements the array is going to hold, must be a constant value, since arrays are blocks of non-dynamic memory whose size must be determined before execution.
VALID OPERATIONS WITH ARRAYS:-billy[0] = a;billy[a] = 75;b = billy [a+2];billy[billy[a]] = billy[2] + 5;PROGRAM:-      // arrays example#include <iostream>using namespace std; int billy [] = {16, 2, 77, 40, 12071};int n, result=0;int main ()                                                     OUTPUT:-   12206{  for ( n=0 ; n<5 ; n++ )  { result += billy[n]; } cout << result; return 0;} 
FUNCTIONS:-Function groups a number of program statements into a unit and gives it a name. This unit can be invoked from other parts of a program. A computer program cannot handle all the tasks by it self. Instead its requests other program like entities – called functions in C – to get its tasks done. A function is a self contained block of statements that perform a coherent task of same kind.The name of the function is unique in a C Program and is Global. It means that a function can be accessed from any location with in a C Program. We pass information to the function called arguments specified when the function is called. And the function either returns some value to the point it was called from or returns nothing.We can divide a long C program into small blocks which can perform a certain task. A function is a self contained block of statements that perform a coherent task of same kind. We first declare the function and then at the end of the program we define the function.
POINTERS:-The memory of your computer can be imagined as a succession of memory cells, each one of the minimal size that computers manage (one byte). These single-byte memory cells are numbered in a consecutive way, so as, within any block of memory, every cell has the same number as the previous one plus one.This way, each cell can be easily located in the memory because it has a unique address and all the memory cells follow a successive pattern. For example, if we are looking for cell 1776 we know that it is going to be right between cells 1775 and 1777, exactly one thousand cells after 776 and exactly one thousand cells before cell 2776.The general form of declaring the pointer is                           type*ptr;
REFERENCES:-	It is an alternative name for an object. A reference variable provides an alias for a previously defined variable. It’s declaration consists of  a base type, an &(ampersand), a reference variable name equated to a variable name.   the general form of declaring is:-          type&ref-var = var-name;
CONSTANTS:-C++ constants are not very different from any C++ variable. They are defined in a similar way and have the same data types and the same memory limitations. However, there is one major difference - once a constant has been created and value assigned to it then that value may not be changed.Defining Constants with C++There are actually three ways of defining a constant in a C++ program:by using the preprocessorby using the const key wordby using enumerators - these will have a range of integer valuesIt's also worth noting that there are two types of constant: literal and symbolic.   the general form of declaring a variable is:-                   const int upperage = 50;
CLASSSTRUCTUREUSER DEFINED DERIVED DATA TYPESUNIONENUMERATION
CLASSClass: A class is a collection of variables and function under one reference name. it is the way of separating and storing similar data together. Member functions are often the means of accessing, modifying and operating the data members (i.e. variables). It is one of the most important features of C++ since OOP is usually implemented through the use of classes.
Classes are generally declared using the keyword class, with the following format:class class_name {  access_specifier_1:                        member1;  access_specifier_2:    member2;  ...        } object_names;
STRUCTURES:-A data structure is a group of data elements grouped together under one name. These data elements, known as members, can have different types and different lengths.Data structures are declared in C++ using the following syntax:struct structure_name {member_type1 member_name1;member_type2 member_name2;member_type3 member_name3;..} object_names; where structure_name is a name for the structure type, object_name can be a set of valid identifiers for objects that have the type of this structure. Within braces { } there is a list with the data members, each one is specified with a type and a valid identifier as its name.Structure is different from an array in the sense that an array represents an aggregate of elements of same type whereas a structure represents an aggregate of elements of arbitrary types..
UNION:-Unions allow one same portion of memory to be accessed as different data types, since all of them are in fact the same location in memory. Its declaration and use is similar to the one of structures but its functionality is totally different:union union_name {    member_type1 member_name1;    member_type2 member_name2;    member_type3 member_name3;     .     .   } object_names;All the elements of the union declaration occupy the same physical space in memory. Its size is the one of the greatest element of the declaration. all of them are referring to the same location in memory, the modification of one of the elements will affect the value of all of them. We cannot store different values in them independent of each other.One of the uses a union may have is to unite an elementary type with an array or structures of smaller elements. The exact alignment and order of the members of a union in memory is platform dependant. Therefore be aware of possible portability issues with this type of use.
ENUMERATION:-It can be used to assign names to integer constants.  //Program to illustrate Enumerator  #include<iostream.h>  void main(void)  {enum type{POOR,GOOD,EXCELLENT};//this is the syntax of enumerator          int var;         var=POOR;//this makes programs more understandable         cout<<var<<endl;         var=GOOD;         cout<<var<<endl;         var=EXCELLENT;         cout<<var;     }//poor=0     good=1     excellent=2
CONCLUSION:-We have so many data types to allow the programmer to take advantage of hardware characteristics. Machines are significantly different in their memory requirements, memory access times, and computation speeds.
THANK YOU

More Related Content

What's hot (20)

PPTX
Data types in java
HarshitaAshwani
 
PPTX
Type casting in java
Farooq Baloch
 
PDF
Arrays in Java
Naz Abdalla
 
PPTX
Constructor and destructor
Shubham Vishwambhar
 
PPTX
Java Tokens
Madishetty Prathibha
 
PPTX
Overloading vs Overriding.pptx
Karudaiyar Ganapathy
 
PPT
Data models
Usman Tariq
 
PPTX
Data Type in C Programming
Qazi Shahzad Ali
 
PPTX
interface in c#
Deepti Pillai
 
PPTX
Pointers in C Programming
Jasleen Kaur (Chandigarh University)
 
PPTX
Data types in c++
Venkata.Manish Reddy
 
PPTX
Exception handling in Java
Ankit Rai
 
PPTX
C keywords and identifiers
Akhileshwar Reddy Ankireddy
 
PPT
Object-oriented concepts
BG Java EE Course
 
PPT
Data types
myrajendra
 
PPT
Abstract data types
Poojith Chowdhary
 
PPTX
Type casting in c programming
Rumman Ansari
 
PPTX
Strings in c#
Dr.Neeraj Kumar Pandey
 
PPTX
OOPS In JAVA.pptx
Sachin33417
 
PPTX
Exception Handling in object oriented programming using C++
Janki Shah
 
Data types in java
HarshitaAshwani
 
Type casting in java
Farooq Baloch
 
Arrays in Java
Naz Abdalla
 
Constructor and destructor
Shubham Vishwambhar
 
Overloading vs Overriding.pptx
Karudaiyar Ganapathy
 
Data models
Usman Tariq
 
Data Type in C Programming
Qazi Shahzad Ali
 
interface in c#
Deepti Pillai
 
Pointers in C Programming
Jasleen Kaur (Chandigarh University)
 
Data types in c++
Venkata.Manish Reddy
 
Exception handling in Java
Ankit Rai
 
C keywords and identifiers
Akhileshwar Reddy Ankireddy
 
Object-oriented concepts
BG Java EE Course
 
Data types
myrajendra
 
Abstract data types
Poojith Chowdhary
 
Type casting in c programming
Rumman Ansari
 
Strings in c#
Dr.Neeraj Kumar Pandey
 
OOPS In JAVA.pptx
Sachin33417
 
Exception Handling in object oriented programming using C++
Janki Shah
 

Similar to Concept Of C++ Data Types (20)

PPTX
Concept of c data types
Manisha Keim
 
PPT
Data Handling
Praveen M Jigajinni
 
PPT
C++ data types
pratikborsadiya
 
PPTX
Data types
Sachin Satwaskar
 
PPTX
Chapter 2.datatypes and operators
Jasleen Kaur (Chandigarh University)
 
PPTX
OOPS (object oriented programming) unit 1
AnamikaDhoundiyal
 
PPT
C++ tutorials
Divyanshu Dubey
 
PDF
Cpprm
Shawne Lee
 
PPTX
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
jatin batra
 
DOCX
c++ best code.docxhsdsdcvcdcdvdvdvdvdcdv
LegesseSamuel1
 
PPTX
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
DeepasCSE
 
PPTX
c++ introduction, array, pointers included.pptx
fn723290
 
PPTX
BASIC CONCEPTS OF C++ CLASS 12
Dev Chauhan
 
PDF
variablesfinal-170820055428 data type results
atifmugheesv
 
PPTX
Variables in C++, data types in c++
Neeru Mittal
 
PPT
Datatypes
ZTE Nepal
 
PPTX
Chapter1.pptx
WondimuBantihun1
 
PDF
THE C++ LECTURE 2 ON DATA STRUCTURES OF C++
sanatahiratoz0to9
 
PPTX
2. Variables and Data Types in C++ proramming.pptx
Ahmad177077
 
PPTX
OOC MODULE1.pptx
1HK19CS090MOHAMMEDSA
 
Concept of c data types
Manisha Keim
 
Data Handling
Praveen M Jigajinni
 
C++ data types
pratikborsadiya
 
Data types
Sachin Satwaskar
 
Chapter 2.datatypes and operators
Jasleen Kaur (Chandigarh University)
 
OOPS (object oriented programming) unit 1
AnamikaDhoundiyal
 
C++ tutorials
Divyanshu Dubey
 
Cpprm
Shawne Lee
 
C++ Langauage Training in Ambala ! BATRA COMPUTER CENTRE
jatin batra
 
c++ best code.docxhsdsdcvcdcdvdvdvdvdcdv
LegesseSamuel1
 
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
DeepasCSE
 
c++ introduction, array, pointers included.pptx
fn723290
 
BASIC CONCEPTS OF C++ CLASS 12
Dev Chauhan
 
variablesfinal-170820055428 data type results
atifmugheesv
 
Variables in C++, data types in c++
Neeru Mittal
 
Datatypes
ZTE Nepal
 
Chapter1.pptx
WondimuBantihun1
 
THE C++ LECTURE 2 ON DATA STRUCTURES OF C++
sanatahiratoz0to9
 
2. Variables and Data Types in C++ proramming.pptx
Ahmad177077
 
OOC MODULE1.pptx
1HK19CS090MOHAMMEDSA
 
Ad

Recently uploaded (20)

PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Horarios de distribución de agua en julio
pegazohn1978
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
GRADE-3-PPT-EVE-2025-ENG-Q1-LESSON-1.pptx
EveOdrapngimapNarido
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Ad

Concept Of C++ Data Types

  • 1. CONCEPT OF C++ DATA TYPESMADE BY:- RAFIYA SIRINXI-B
  • 2. DATA TYPESData types are means to identify the type of data and associated operations of handling it. C++ provides a predefined set of data types for handling the data it uses. When variables are declared of a particular data type then the variable becomes the place where the data is stored and data types is the type of value(data) stored by that variable. Data can be of may types such as character, integer, real etc. since the data to be dealt with are of may types, a programming language must provide different data types.
  • 3. FUNDAMENTAL DATA TYPESDATA TYPE MODIFIERSDATA TYPESDERIVED DATA TYPESUSER DEFINED DATA TYPES
  • 4. INTEGERCHARACTERFUNDAMENTAL DATA TYPESFLOATFUNDAMENTAL DATA TYPES ARE THOSE THAT ARE NOT COMPOSED OF OTHER DATA TYPESDOUBLEVOID
  • 5. INTEGER DATA TYPEIntegers are whole numbers with a machine dependent range of values. A good programming language as to support the programmer by giving a control on a range of numbers and storage space. C has 3 classes of integer storage namely short int, int and long int. All of these data types have signed and unsigned forms. A short int requires half the space than normal integer values. Unsigned numbers are always positive and consume all the bits for the magnitude of the number. The long and unsigned integers are used to declare a longer range of values.
  • 6. CHARACTER DATA TYPEIt can store any member of the C++ implementation's basic character set. If a character from this set is stored in a character variable, its value is equivalent to the integer code of that character. Character data type is often called as integer data type because the memory implementation of char data type is in terms of the number code.
  • 7. FLOAT DATA TYPEA number having fractional part is a floating- point number. An identifier declared as float becomes a floating-point variable and can hold floating-point numbers. floating point variables represent real numbers. They have two advantages over integer data types:-1: they can represent values between integers.2: they can represent a much greater range of values.they have one disadvantage also, that is their operations are usually slower.
  • 8. The data type double is also used for handling floating-point numbers. But it is treated as a distinct data type because, it occupies twice as much memory as type float, and stores floating-point numbers with much larger range and precision. It is slower that type float.DOUBLE DATA TYPE
  • 9. VOID DATA TYPEIt specifies an empty set of values. It is used as the return type for functions that do not return a value. No object of type void may be declared. It is used when program or calculation does not require any value but the syntax needs it.
  • 10. INTEGER TYPE MODIFIERSDATA TYPE MODIFIERSCHARACTER TYPEMODIFIERSTHEY CHANGE SOME PROPERTIES OF THE DATA TYPEFLOATING-POINT MODIFIERS
  • 11. INTEGER TYPE MODIFIERSC++ offers three types of integer data type:-1:- short integer- at least two bytes.2:- int integer – at least as big as short.3:- long integer-at least four bytes. the prefix signed makes the integer type hold negative values also. Unsigned makes the integer not to hold negative values.
  • 13. CHARACTER TYPE MODIFIERThe char can also be signed or unsigned. unlike int,char is not signed or unsigned by default. It is later modified to best fit the type to the hardware properties.
  • 14. FLOATING POINT TYPE MODIFIERSThere are three floating-point types: float, double, and long double. These types represent minimum allowable range of types.Note:- don’t use commas in numeric values assigned to variables.
  • 17. ARRAYSAn array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier.That means that, for example, we can store 5 values of type int in an array without having to declare 5 different variables, each one with a different identifier. Instead of that, using an array we can store 5 different values of the same type, int for example, with a unique identifier.Like a regular variable, an array must be declared before it is used. A typical declaration for an array in C++ is:type name [elements];NOTE: The elements field within brackets [ ] which represents the number of elements the array is going to hold, must be a constant value, since arrays are blocks of non-dynamic memory whose size must be determined before execution.
  • 18. VALID OPERATIONS WITH ARRAYS:-billy[0] = a;billy[a] = 75;b = billy [a+2];billy[billy[a]] = billy[2] + 5;PROGRAM:-  // arrays example#include <iostream>using namespace std; int billy [] = {16, 2, 77, 40, 12071};int n, result=0;int main () OUTPUT:- 12206{ for ( n=0 ; n<5 ; n++ ) { result += billy[n]; } cout << result; return 0;} 
  • 19. FUNCTIONS:-Function groups a number of program statements into a unit and gives it a name. This unit can be invoked from other parts of a program. A computer program cannot handle all the tasks by it self. Instead its requests other program like entities – called functions in C – to get its tasks done. A function is a self contained block of statements that perform a coherent task of same kind.The name of the function is unique in a C Program and is Global. It means that a function can be accessed from any location with in a C Program. We pass information to the function called arguments specified when the function is called. And the function either returns some value to the point it was called from or returns nothing.We can divide a long C program into small blocks which can perform a certain task. A function is a self contained block of statements that perform a coherent task of same kind. We first declare the function and then at the end of the program we define the function.
  • 20. POINTERS:-The memory of your computer can be imagined as a succession of memory cells, each one of the minimal size that computers manage (one byte). These single-byte memory cells are numbered in a consecutive way, so as, within any block of memory, every cell has the same number as the previous one plus one.This way, each cell can be easily located in the memory because it has a unique address and all the memory cells follow a successive pattern. For example, if we are looking for cell 1776 we know that it is going to be right between cells 1775 and 1777, exactly one thousand cells after 776 and exactly one thousand cells before cell 2776.The general form of declaring the pointer is type*ptr;
  • 21. REFERENCES:- It is an alternative name for an object. A reference variable provides an alias for a previously defined variable. It’s declaration consists of a base type, an &(ampersand), a reference variable name equated to a variable name. the general form of declaring is:- type&ref-var = var-name;
  • 22. CONSTANTS:-C++ constants are not very different from any C++ variable. They are defined in a similar way and have the same data types and the same memory limitations. However, there is one major difference - once a constant has been created and value assigned to it then that value may not be changed.Defining Constants with C++There are actually three ways of defining a constant in a C++ program:by using the preprocessorby using the const key wordby using enumerators - these will have a range of integer valuesIt's also worth noting that there are two types of constant: literal and symbolic. the general form of declaring a variable is:- const int upperage = 50;
  • 23. CLASSSTRUCTUREUSER DEFINED DERIVED DATA TYPESUNIONENUMERATION
  • 24. CLASSClass: A class is a collection of variables and function under one reference name. it is the way of separating and storing similar data together. Member functions are often the means of accessing, modifying and operating the data members (i.e. variables). It is one of the most important features of C++ since OOP is usually implemented through the use of classes.
  • 25. Classes are generally declared using the keyword class, with the following format:class class_name { access_specifier_1: member1; access_specifier_2: member2; ... } object_names;
  • 26. STRUCTURES:-A data structure is a group of data elements grouped together under one name. These data elements, known as members, can have different types and different lengths.Data structures are declared in C++ using the following syntax:struct structure_name {member_type1 member_name1;member_type2 member_name2;member_type3 member_name3;..} object_names; where structure_name is a name for the structure type, object_name can be a set of valid identifiers for objects that have the type of this structure. Within braces { } there is a list with the data members, each one is specified with a type and a valid identifier as its name.Structure is different from an array in the sense that an array represents an aggregate of elements of same type whereas a structure represents an aggregate of elements of arbitrary types..
  • 27. UNION:-Unions allow one same portion of memory to be accessed as different data types, since all of them are in fact the same location in memory. Its declaration and use is similar to the one of structures but its functionality is totally different:union union_name { member_type1 member_name1; member_type2 member_name2; member_type3 member_name3; . . } object_names;All the elements of the union declaration occupy the same physical space in memory. Its size is the one of the greatest element of the declaration. all of them are referring to the same location in memory, the modification of one of the elements will affect the value of all of them. We cannot store different values in them independent of each other.One of the uses a union may have is to unite an elementary type with an array or structures of smaller elements. The exact alignment and order of the members of a union in memory is platform dependant. Therefore be aware of possible portability issues with this type of use.
  • 28. ENUMERATION:-It can be used to assign names to integer constants. //Program to illustrate Enumerator #include<iostream.h> void main(void) {enum type{POOR,GOOD,EXCELLENT};//this is the syntax of enumerator  int var; var=POOR;//this makes programs more understandable cout<<var<<endl; var=GOOD; cout<<var<<endl; var=EXCELLENT; cout<<var; }//poor=0 good=1 excellent=2
  • 29. CONCLUSION:-We have so many data types to allow the programmer to take advantage of hardware characteristics. Machines are significantly different in their memory requirements, memory access times, and computation speeds.