C++ Data Types

Variables in C++  allocate the memory to store the values in the program. C++ Data types are the type of data that the variable holds. For example: an integer variable holds integer data types, a character variable holds character data types, string variable holds string data type, etc.

Data Types in C++ is mainly of three types:

  1. Built-in
  2. User-defined
  3. Derived

User Defined Data Types

There are three types of user-defined data types in C++. They are:

  1. struct
  2. union
  3. enum

Built-in Data Types

These data types are also known as primitive data types and the user can directly use it to declare variables.For example:int,bool,float,double etc.

Some of the built-in data types available in C++are:

1.Integer:Size=2 bytes.

2.Float: For single precision floating point.Size=4 bytes.

3.Double: For double precision floating point.Size=8 bytes.

4.Character:Size=1 bytes.

5.bool:For booleans,true or false.

Derived Data Types in C++

There are three types of derived data types in C++. They are listed below:

  1. Array
  2. Function
  3. Pointer
SHARE C++ Data Types

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Share