SlideShare a Scribd company logo
2
Most read
8
Most read
9
Most read
Sanjivani Rural Education Society’s
Sanjivani College of Engineering, Kopargaon-423 603
(An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune)
NAAC ‘A’Grade Accredited, ISO 9001:2015 Certified
Department of Computer Engineering
(NBA Accredited)
Subject- Object Oriented Programming (CO212)
Unit 1 – Fundamentals of OOP
Topic – 1.5 Data Types in C++
Prof. V.N.Nirgude
Assistant Professor
E-mail :
nirgudevikascomp@sanjivani.org.in
Contact No: 9975240215
Data type
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 2
➢ A data type specifies the type of value a variable can hold.
➢ General syntax of declaration of data type is:
data_type variable_name;
➢ Example:
int a;
C++ DATATYPES
USER-DEFINED TYPE BUILT-IN TYPE DERIVED TYPE
INTEGRAL TYPE VOID FLOATING TYPE
STRUCTURE
UNION
CLASS
ENUMERATION
ARRAY
FUNCTION
POINTER
int char float double
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 3
INTEGRAL DATATYPE
INTEGER DATATYPE:
➢ Keyword: int
➢ Storage space: two bytes
➢ Range of int: -32768 to 32767
CHARACTER DATATYPE:
➢ Keyword: char
➢ Storage space: 1 byte
➢ Range of char: -128 to 127
INTEGRAL TYPE
int char
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 4
FLOAT DATATYPE
➢ Keyword: float
➢ Storage space: 4 bytes
➢ Range of float: 3.4e-38 to 3.4e+38.
FLOATING TYPE
float double
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 5
• Type void was introduced in ANSI C.
Two normal use of void:
➢ To specify the return type of a function when it
is not returning any value.
➢ To indicate an empty argument list to a
function.
Eg:- void function-name ( void )
VOID DATATYPE
BUILT-IN TYPE
VOID
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 6
User Defined Type
C++ DATATYPES
USER-DEFINED TYPE
STRUCTURE
UNION
CLASS
ENUMERATION
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 7
User Defined Type
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 8
• STRUCTURES:
➢ Structures are used for grouping together elements with dissimilar
types.
➢ The general syntax of a structure:-
struct struct_name
{
Data_type member1;
. . . . .
};
User Defined Type
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 9
• Unions:
➢ Unions are conceptually similar to structures as they allow us
to group together dissimilar type elements inside a single unit.
User Defined Type
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 10
• CLASSES:
➢The entire set of data and functions can be
defined data type with the help of a class.
➢ Once a class has been defined, we can create
objects belonging to that class.
➢ Example: fruit mango;
made a user-
any number of
➢ Created an object mango belonging to the class fruit.
Derived Type
C++ DATATYPES
DERIVED TYPE
ARRAY
FUNCTION
POINTER
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 11
Derived Type
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 12
• ARRAYS:
➢An array is a fixed sequence collection of elements of same
data type that share a common name.
➢ General syntax is:
data_type array_name[size];
➢ Example:
int a[10];
Derived Type
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 13
• FUNCTIONS:
➢ A function is a group of statements that together perform a task.
➢Every c++ program has at least one function, which is
main().
void main()
{
Statements;
}
Derived Type
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 14
• POINTERS:
➢ A pointer is a variable that holds a memory address.
➢ General syntax to declare pointer is:-
Data_type *pointer_name;
➢ Example:
int *p;
Thank You..
DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 15

More Related Content

PDF
1.3 Object Oriented Programming Paradigm, Basic Concepts of Object-Oriented P...
PDF
Progecad 2025 Professional Cracked [Latest]
PDF
1.9 Class,Object,Class Scope,Accessing Class members and Controlling access t...
PDF
OOP concepts with respected with Python
PPTX
OOP Unit 2 - Classes and Object
PPTX
OOP CHAPTER object oreinted programming using c++
PDF
Object Oriented Programming Lecture Notes
PDF
1.1 Introduction to procedural, modular, object-oriented and generic programm...
1.3 Object Oriented Programming Paradigm, Basic Concepts of Object-Oriented P...
Progecad 2025 Professional Cracked [Latest]
1.9 Class,Object,Class Scope,Accessing Class members and Controlling access t...
OOP concepts with respected with Python
OOP Unit 2 - Classes and Object
OOP CHAPTER object oreinted programming using c++
Object Oriented Programming Lecture Notes
1.1 Introduction to procedural, modular, object-oriented and generic programm...

Similar to 1.5 Data Types in C++ and Its Details.pdf (20)

PPTX
JAVA PROGRAMMINGD
PDF
Object Oriented Programming With C 2140705 Darshan All Unit Darshan Institute...
PDF
22601221182_RAHUL_MODAK_BCAC301.pdf
PPTX
Birasa 1
PPTX
JAVA PROGRAMMING
PDF
Object Oriented Programming Constructors & Destructors
PDF
Introduction Object Oriented Programming Concept in Java
PPTX
Introduction to Java -unit-1
PPTX
Unit - I Fundamentals of Object Oriented Programming .pptx
PDF
OOPS_Unit_1
PDF
2nd PUC computer science chapter 6 oop concept
PPT
Share Unit 1- Basic concept of object-oriented-programming.ppt
PPTX
Object Oriented Programming intro Lecture 1.pptx
PPTX
OOP-1.pptx
PPTX
Unit - I Intro. to OOP Concepts and Control Structure -OOP and CG (2024 Patte...
PPTX
CPP-Unit 1.pptx
PPT
PPTX
4.1 Function Templates,Overlaoding Function Templates.pptx
PPT
OOSE Unit 3 PPT.ppt
JAVA PROGRAMMINGD
Object Oriented Programming With C 2140705 Darshan All Unit Darshan Institute...
22601221182_RAHUL_MODAK_BCAC301.pdf
Birasa 1
JAVA PROGRAMMING
Object Oriented Programming Constructors & Destructors
Introduction Object Oriented Programming Concept in Java
Introduction to Java -unit-1
Unit - I Fundamentals of Object Oriented Programming .pptx
OOPS_Unit_1
2nd PUC computer science chapter 6 oop concept
Share Unit 1- Basic concept of object-oriented-programming.ppt
Object Oriented Programming intro Lecture 1.pptx
OOP-1.pptx
Unit - I Intro. to OOP Concepts and Control Structure -OOP and CG (2024 Patte...
CPP-Unit 1.pptx
4.1 Function Templates,Overlaoding Function Templates.pptx
OOSE Unit 3 PPT.ppt
Ad

More from VikasNirgude2 (18)

PDF
2.8 Constructor and Destructor in Derived Class.pdf
PDF
4.2 Class Template, Template and Inheritance.pdf
PDF
Function Templates,Overlaoding Function Templates.pdf
PDF
Introduction to Inheritance and Its concepts
PDF
Data Conversion and Type Casting Concepts
PDF
Operator Overloading Introduction and Concept of OV
PDF
1.11 Constructors and Destructors....pdf
PDF
1.10 Functions in C++,call by value .pdf
PDF
1.7 Arrays in C++ and its detail........pdf
PDF
1.6 Control Structures in C++ .......pdf
PDF
C++ programming Basic and Operators of C++
PDF
1.2 Need of Object-Oriented Programming.pdf
PDF
B Tree, Introduction ,example,Splay tree
PPT
Tree-introduction ,Definition, Types of BT
PPTX
Double Hashing.pptx
PPTX
closed hashing.pptx
PPTX
Collision resolution.pptx
PPTX
closed hashing.pptx
2.8 Constructor and Destructor in Derived Class.pdf
4.2 Class Template, Template and Inheritance.pdf
Function Templates,Overlaoding Function Templates.pdf
Introduction to Inheritance and Its concepts
Data Conversion and Type Casting Concepts
Operator Overloading Introduction and Concept of OV
1.11 Constructors and Destructors....pdf
1.10 Functions in C++,call by value .pdf
1.7 Arrays in C++ and its detail........pdf
1.6 Control Structures in C++ .......pdf
C++ programming Basic and Operators of C++
1.2 Need of Object-Oriented Programming.pdf
B Tree, Introduction ,example,Splay tree
Tree-introduction ,Definition, Types of BT
Double Hashing.pptx
closed hashing.pptx
Collision resolution.pptx
closed hashing.pptx
Ad

Recently uploaded (20)

PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPT
Mechanical Engineering MATERIALS Selection
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
DOCX
573137875-Attendance-Management-System-original
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
Well-logging-methods_new................
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Current and future trends in Computer Vision.pptx
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
web development for engineering and engineering
PPTX
additive manufacturing of ss316l using mig welding
R24 SURVEYING LAB MANUAL for civil enggi
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Mechanical Engineering MATERIALS Selection
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Foundation to blockchain - A guide to Blockchain Tech
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
573137875-Attendance-Management-System-original
Embodied AI: Ushering in the Next Era of Intelligent Systems
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Well-logging-methods_new................
CH1 Production IntroductoryConcepts.pptx
Current and future trends in Computer Vision.pptx
III.4.1.2_The_Space_Environment.p pdffdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
bas. eng. economics group 4 presentation 1.pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
web development for engineering and engineering
additive manufacturing of ss316l using mig welding

1.5 Data Types in C++ and Its Details.pdf

  • 1. Sanjivani Rural Education Society’s Sanjivani College of Engineering, Kopargaon-423 603 (An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune) NAAC ‘A’Grade Accredited, ISO 9001:2015 Certified Department of Computer Engineering (NBA Accredited) Subject- Object Oriented Programming (CO212) Unit 1 – Fundamentals of OOP Topic – 1.5 Data Types in C++ Prof. V.N.Nirgude Assistant Professor E-mail : nirgudevikascomp@sanjivani.org.in Contact No: 9975240215
  • 2. Data type DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 2 ➢ A data type specifies the type of value a variable can hold. ➢ General syntax of declaration of data type is: data_type variable_name; ➢ Example: int a;
  • 3. C++ DATATYPES USER-DEFINED TYPE BUILT-IN TYPE DERIVED TYPE INTEGRAL TYPE VOID FLOATING TYPE STRUCTURE UNION CLASS ENUMERATION ARRAY FUNCTION POINTER int char float double DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 3
  • 4. INTEGRAL DATATYPE INTEGER DATATYPE: ➢ Keyword: int ➢ Storage space: two bytes ➢ Range of int: -32768 to 32767 CHARACTER DATATYPE: ➢ Keyword: char ➢ Storage space: 1 byte ➢ Range of char: -128 to 127 INTEGRAL TYPE int char DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 4
  • 5. FLOAT DATATYPE ➢ Keyword: float ➢ Storage space: 4 bytes ➢ Range of float: 3.4e-38 to 3.4e+38. FLOATING TYPE float double DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 5
  • 6. • Type void was introduced in ANSI C. Two normal use of void: ➢ To specify the return type of a function when it is not returning any value. ➢ To indicate an empty argument list to a function. Eg:- void function-name ( void ) VOID DATATYPE BUILT-IN TYPE VOID DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 6
  • 7. User Defined Type C++ DATATYPES USER-DEFINED TYPE STRUCTURE UNION CLASS ENUMERATION DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 7
  • 8. User Defined Type DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 8 • STRUCTURES: ➢ Structures are used for grouping together elements with dissimilar types. ➢ The general syntax of a structure:- struct struct_name { Data_type member1; . . . . . };
  • 9. User Defined Type DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 9 • Unions: ➢ Unions are conceptually similar to structures as they allow us to group together dissimilar type elements inside a single unit.
  • 10. User Defined Type DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 10 • CLASSES: ➢The entire set of data and functions can be defined data type with the help of a class. ➢ Once a class has been defined, we can create objects belonging to that class. ➢ Example: fruit mango; made a user- any number of ➢ Created an object mango belonging to the class fruit.
  • 11. Derived Type C++ DATATYPES DERIVED TYPE ARRAY FUNCTION POINTER DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 11
  • 12. Derived Type DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 12 • ARRAYS: ➢An array is a fixed sequence collection of elements of same data type that share a common name. ➢ General syntax is: data_type array_name[size]; ➢ Example: int a[10];
  • 13. Derived Type DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 13 • FUNCTIONS: ➢ A function is a group of statements that together perform a task. ➢Every c++ program has at least one function, which is main(). void main() { Statements; }
  • 14. Derived Type DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 14 • POINTERS: ➢ A pointer is a variable that holds a memory address. ➢ General syntax to declare pointer is:- Data_type *pointer_name; ➢ Example: int *p;
  • 15. Thank You.. DEPARTMENT OF COMPUTER ENGINEERING , SCOE,KOPARGAON 15