Data Types
1. C++ supports the following
data types:
1.Primary or Built-in or Fundamental data type
2.Derived data types
3.User-defined data types
1.1 Primitive Data Types :)
• These data types are built-in or predefined data types and
can be used directly by the user to declare variables.
• Integer
• Character
• Boolean
• Floating Point
• Double Floating Point
1.2 Derived Data Types :)
• Derived data types that are derived from the primitive
or built-in datatypes are referred to as Derived Data
Types.
• Function
• Array
• Pointer
• Reference
1. 3 User-Defined Data Types :)
• Abstract or User-Defined data types are defined by the user
itself.
• Class
• Structure
• Union
• Enumeration
• Typedef defined Datatype
2. Range and there space in
memory of Basic data types :)
• Integer: The keyword used for integer data types is int.
Integers typically require 4 bytes of memory space and
range from -2147483648 to 2147483647.
• Character: Character data type is used for storing
characters. The keyword used for the character data
type is char. Characters typically require 1 byte of
memory space and range from -128 to 127 or 0 to 255.
• Boolean: Boolean data type is used for storing Boolean
or logical values. A Boolean variable can store
either true or false. The keyword used for the Boolean
data type is bool.
• Floating Point: Floating Point data type is used for
storing single-precision floating-point values or decimal
values. The keyword used for the floating-point data
type is float. Float variables typically require 4 bytes of
memory space.
• Double Floating Point: Double Floating Point data
type is used for storing double-precision floating-point
values or decimal values. The keyword used for the
double floating-point data type is double. Double
variables typically require 8 bytes of memory space.