I. Simple data types
Data types describe the amount of space an object occupies in the memory store, describing the range of data that an object can represent
and types. The commonly used data types in the C + + language are integer, real, and character (these 3 types are also known as simple numbers
Type), array type, Boolean type, enum type, struct type, common body type, pointer type, reference class
type and so on.
1. Shaping
Integral type according to the symbol, can be divided into signed integer and unsigned integer two categories, from the length division, can be divided into
General integer, short integer, and Long Integer Class 3.
2. Real type
The real type mainly includes single precision type, double type and long double precision type.
10, 010, 0x10, 10u, 10L, 10UL, 10F
3. Character types
In the C + + language, character type data is represented in single quotation marks.
'a', ' A', 'b','b', etc.
Defining character type data can use the Char keyword, for example: char chdata = ' N ';
Two. Boolean type
There are only two values in logical judgment, that is, true and false. Boolean type--bool is provided in the program to describe the truth and false values of logical judgments . The data type provides two values of true and false, that is, truth and false values. Boolean type data can be treated as an integer type, and true means that 1,false represents 0.
You can assign a Boolean type object to an integer type object in your program, or you can assign an integer type object to a Boolean type object.
Three. I have thick skin, if you feel OK, give me a kiss, right? (°?‵?′??)
c++--Simple data types and Boolean types