20 Nov 2019

  • November 20, 2019
  • Amitraj
C++ Data Types

Data types define the type of data a variable can hold, for example an integer variable can hold integer data, a character type variable can hold character data etc.

Data types in C++ are categorised in three groups:  Built-in, user-defined and Derived.










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.   example: int, char , float, bool etc. Primitive data types available in C++ are:

-> Integer
-> Character
-> Void
-> Floating Point / float
-> Double Floating Point / Doble
-> Boolean


2.) Derived Data Types: 
  The data-types that are derived from the primitive or built-in datatypes are referred to as Derived Data Types. These can be of four types namely:

-> Array
-> Function
-> Pointer
-> Reference


3.) Abstract or User-Defined Data Types: 
  These data types are defined by user itself. Like, defining a class in C++ or a structure. C++ provides the following user-defined datatypes:

-> Structure
-> Union
-> Class
-> Enumeration
-> Typedef defined DataType



Translate

Popular Posts