SlideShare a Scribd company logo
1 of 11
DATATYPES IN
Overview
 Introduction to C++
 What are datatypes
 Datatypes in C++ :
 Primary
 Derived
 User-defined
 Conclusion
Introduction to C++
C++ is a general-purpose programming language and is widely used nowadays for
competitive programming. It was developed to enhance the C language with
object-oriented programming.
Features of C++:
 It is an object-oriented programming language
 It is a mid-level language.
 It is a machine independent but platform-dependent language
 It has a rich library support
 It has a high speed of execution.
There is no official documentation for C++ available, however the closest
available document is the C++ Core Guidelines.
What are Datatypes?
To define datatypes we first need to know what are variables and its types.
 VARIABLE - A variable is a named unit of data that is assigned a value.
 DATATYPE - A data type is a classification that restricts what a variable or
object can hold in computer programming. They specify the size and type of
the value to be stored in the variable.
In the given image ‘int’ and ‘char’ are the datatypes
whereas ‘item1’ and ‘item2’ are variables.
Datatypes in C++
C++ supports a variety of datatypes and the developer can choose the datatype
according to its needs.
They can be broadly classified into three categories: Primitive, Derived and User Defined
Datatypes
in C++
Primitive Derived
User
Defined
• Int
• Char
• Double
• Boolean
• Void
• Function
• Array
• Pointer
• Reference
• Class
• Structure
• Union
• Enum
Primitive Datatypes
These datatypes are built-in or predefined in the language itself. They can directly
be used to declare the variables.
Primitive datatypes are of the following types:
 Integer
 Character
 Boolean
 Floating Point
 Double Floating Point
 Void or Valueless
 Wide Character
The sizeof() operator is used to find out the number of bytes occupied by the
datatype in the memory.
This code demonstrates the use to sizeof operator
to find the memory occupied by a primitive
datatype in your computer
Data Type Size(in bytes)
Char 1
Int 4
bool 1
Float 4
double 8
The output of the previous code. Results may
vary from machine to machine
Derived Datatypes
These are datatypes which have been derived from built-in datatypes.
Primarily they are of the following types:
 Function
 Array
 Pointer
 Reference
The above code demonstrates the use of derived
data types – arrays, function and pointers.
User Defined Datatypes
These datatypes are defined by the users themselves. These datatypes generally
contain a combination of many primitive and derived datatypes.
Primarily they are of the following types:
 Class
 Structure
 Union
 Enum
The above code demonstrates the use of user
defined data types – structures
Conclusion
When writing a program, a programmer must properly define
event and entity properties and for that they must have to
have a good understanding of data types.
Application of knowledge on datatypes is not limited to data
collection or instrumentation; other activities such as data
management, data integration, and internal application
development (using no-code or low-code tools) also require
proper knowledge of datatypes.
THANK YOU
https://www.cetpainfotech.com/
9212172602
QUERY@CETPAINFOTECH.COM

More Related Content

What's hot (20)

data types in C programming
data types in C programmingdata types in C programming
data types in C programming
 
Variables in python
Variables in pythonVariables in python
Variables in python
 
Python ppt
Python pptPython ppt
Python ppt
 
Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2
 
FUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
Presentation on pointer.
Presentation on pointer.Presentation on pointer.
Presentation on pointer.
 
Introduction to c++ ppt
Introduction to c++ pptIntroduction to c++ ppt
Introduction to c++ ppt
 
Function overloading ppt
Function overloading pptFunction overloading ppt
Function overloading ppt
 
Pointers in c++
Pointers in c++Pointers in c++
Pointers in c++
 
Intro to c++
Intro to c++Intro to c++
Intro to c++
 
Pointer in C++
Pointer in C++Pointer in C++
Pointer in C++
 
structure and union
structure and unionstructure and union
structure and union
 
Python : Data Types
Python : Data TypesPython : Data Types
Python : Data Types
 
Function in c program
Function in c programFunction in c program
Function in c program
 
Functions in C
Functions in CFunctions in C
Functions in C
 
C functions
C functionsC functions
C functions
 
Function Pointer
Function PointerFunction Pointer
Function Pointer
 
Pointer in c
Pointer in cPointer in c
Pointer in c
 

Similar to Datatypes in C++.pptx

Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)jimmy majumder
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsShanmuganathan C
 
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...ssuser5610081
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language Rowank2
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptxRowank2
 
Basic Data Types in C++
Basic Data Types in C++ Basic Data Types in C++
Basic Data Types in C++ Hridoy Bepari
 
java handout.doc
java handout.docjava handout.doc
java handout.docSOMOSCO1
 
Frequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersFrequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersnishajj
 
Semester-1-22-23-Introduction_to_c_programming.ppt
Semester-1-22-23-Introduction_to_c_programming.pptSemester-1-22-23-Introduction_to_c_programming.ppt
Semester-1-22-23-Introduction_to_c_programming.pptChetanChauhan203001
 
Introduction_to_c_programming.ppt for software developing students
Introduction_to_c_programming.ppt for software developing studentsIntroduction_to_c_programming.ppt for software developing students
Introduction_to_c_programming.ppt for software developing studentsAsfiya14
 

Similar to Datatypes in C++.pptx (20)

Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
 
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
Data Types in C++-Primary or Built-in or Fundamental data type Derived data t...
 
Introduction to ‘C’ Language
Introduction to ‘C’ LanguageIntroduction to ‘C’ Language
Introduction to ‘C’ Language
 
Data types
Data typesData types
Data types
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptx
 
Basic Data Types in C++
Basic Data Types in C++ Basic Data Types in C++
Basic Data Types in C++
 
C material
C materialC material
C material
 
java handout.doc
java handout.docjava handout.doc
java handout.doc
 
Frequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersFrequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answers
 
Pc module1
Pc module1Pc module1
Pc module1
 
PRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdfPRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdf
 
Data type
Data typeData type
Data type
 
Python PPT.pptx
Python PPT.pptxPython PPT.pptx
Python PPT.pptx
 
Let's us c language (sabeel Bugti)
Let's us c language (sabeel Bugti)Let's us c language (sabeel Bugti)
Let's us c language (sabeel Bugti)
 
C+++
C+++C+++
C+++
 
Semester-1-22-23-Introduction_to_c_programming.ppt
Semester-1-22-23-Introduction_to_c_programming.pptSemester-1-22-23-Introduction_to_c_programming.ppt
Semester-1-22-23-Introduction_to_c_programming.ppt
 
C.ppt
C.pptC.ppt
C.ppt
 
Introduction_to_c_programming.ppt for software developing students
Introduction_to_c_programming.ppt for software developing studentsIntroduction_to_c_programming.ppt for software developing students
Introduction_to_c_programming.ppt for software developing students
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
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
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
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
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
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
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
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
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
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 🔝✔️✔️
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
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🔝
 

Datatypes in C++.pptx

  • 2. Overview  Introduction to C++  What are datatypes  Datatypes in C++ :  Primary  Derived  User-defined  Conclusion
  • 3. Introduction to C++ C++ is a general-purpose programming language and is widely used nowadays for competitive programming. It was developed to enhance the C language with object-oriented programming. Features of C++:  It is an object-oriented programming language  It is a mid-level language.  It is a machine independent but platform-dependent language  It has a rich library support  It has a high speed of execution. There is no official documentation for C++ available, however the closest available document is the C++ Core Guidelines.
  • 4. What are Datatypes? To define datatypes we first need to know what are variables and its types.  VARIABLE - A variable is a named unit of data that is assigned a value.  DATATYPE - A data type is a classification that restricts what a variable or object can hold in computer programming. They specify the size and type of the value to be stored in the variable. In the given image ‘int’ and ‘char’ are the datatypes whereas ‘item1’ and ‘item2’ are variables.
  • 5. Datatypes in C++ C++ supports a variety of datatypes and the developer can choose the datatype according to its needs. They can be broadly classified into three categories: Primitive, Derived and User Defined Datatypes in C++ Primitive Derived User Defined • Int • Char • Double • Boolean • Void • Function • Array • Pointer • Reference • Class • Structure • Union • Enum
  • 6. Primitive Datatypes These datatypes are built-in or predefined in the language itself. They can directly be used to declare the variables. Primitive datatypes are of the following types:  Integer  Character  Boolean  Floating Point  Double Floating Point  Void or Valueless  Wide Character The sizeof() operator is used to find out the number of bytes occupied by the datatype in the memory.
  • 7. This code demonstrates the use to sizeof operator to find the memory occupied by a primitive datatype in your computer Data Type Size(in bytes) Char 1 Int 4 bool 1 Float 4 double 8 The output of the previous code. Results may vary from machine to machine
  • 8. Derived Datatypes These are datatypes which have been derived from built-in datatypes. Primarily they are of the following types:  Function  Array  Pointer  Reference The above code demonstrates the use of derived data types – arrays, function and pointers.
  • 9. User Defined Datatypes These datatypes are defined by the users themselves. These datatypes generally contain a combination of many primitive and derived datatypes. Primarily they are of the following types:  Class  Structure  Union  Enum The above code demonstrates the use of user defined data types – structures
  • 10. Conclusion When writing a program, a programmer must properly define event and entity properties and for that they must have to have a good understanding of data types. Application of knowledge on datatypes is not limited to data collection or instrumentation; other activities such as data management, data integration, and internal application development (using no-code or low-code tools) also require proper knowledge of datatypes.