In the previous sample codes, we dealt with the variable (a placeholder is used to store a data element) so that we can manipulate the data in the variable for various operations. In C++, we have to define a variable to be of a specific data type so it can only store the specific type of variable that was defined previously. Here is a list of the fundamental data types in C++. We used some of these data types in the previous example:
- Boolean data type (bool), which is used to store two pieces of conditional data only—true or false
- Character data type (char, wchar_t, char16_t, and char32_t), which is used to store a single ASCII character
- Floating point data type (float, double, and long ...