In this section of the C++ tutorial, we will have a look at data types in the C++ programming language. Data types in C++ are keywords that are used to specify the type of data we use in our C++ programs.
Types of Data Types in C++
There are many data-types available in C++. They are classified under two categories:
- Built-In or Fundamental Data types
- Derived or User-Defined Data types
Built-in data types
- Built-in data types are the most basic data-types in C++.
- The term built-in means that they are pre-defined in C++ and can be used directly in a program.
- char, int, float and double are the most common built-in data types.
- Apart from this, we also have void and bool data types.
|Double floating point||double|
Derived data types
- User-defined data types are those which are first declared and defined by the user before use.
- They are composed of built-in data types.
- Examples are : array, structure, union, class, pointers, etc.
Types of user-defined data types in C++