Computer >> Computer tutorials >  >> Programming >> C++

What are primitive data type in C++?


A primitive type is a data type where the values that it can represent have a very simple nature (a number, a character or a truth-value); the primitive types are the most basic building blocks for any programming language and are the base for more complex data types.

C++ has the following primitive data types −

S.No
Type
Description
1boolStores either value true or false.
2charTypically a single octet (one byte). This is an integer type.
3intThe most natural size of an integer for the machine.
4floatA single-precision floating point value.
5doubleA double-precision floating point value.
6voidRepresents the absence of type.