• Home
  • C++ Data Types

C++ Data Types

C++ supports a variety of data types, which are used to store different kinds of data in a program. Here are some of the common data types in C++:

  1. Integral types: These include char, short, int, long, and long long, which are used to store integer values.
  2. Floating-point types: These include float and double, which are used to store decimal values.
  3. Boolean type: The bool type is used to store boolean values, which can be either true or false.
  4. Enumerated types: The enum type is used to define a set of named integer constants.
  5. Pointer types: The * operator is used to declare a pointer type, which stores the memory address of a variable.
  6. Array types: Arrays are used to store a collection of values of the same type.
  7. Structure types: Structures are used to group together related data fields.
  8. Class types: Classes are templates that define the data and behavior of objects.

Overall, these data types are fundamental to the development of C++ programs, and they are used to store and manipulate different kinds of data in a program.