Signed integer:
Short at least 16 digits;
int at least as long as short-;
Long at least 32 bits, and at least int--like length;
A long long is at least 64 bits long and at least long--like;
unsigned integer:
unsigned short
unsigned int
unsigned (equals unsigned int)
unsigned long
unsigned long long
The interval constants of the basic data are defined in the Climits header file;
A special integer:
Char: Used to store alphabetic symbols (ASCII code), usually 8 bits;
You can force the setting char to be signed: signed Char and unsigned char;
wchar_t: Wide-byte, generally 16-bit, used to denote Chinese;
Boolean type:
BOOL: denotes true or false;
Floating point number:
FLOAT: single-precision floating-point 6 is a valid number
Double: dual-precision floating-point 10-bit valid digits
Long double: extended precision floating-point 10-bit valid digits
Note Points of operation:
The behavior of the division operator (/) depends on the type of the operand. If the two operands are integers, C + + performs integer division. This means that the decimal part of the result is discarded, so that the result after bismuth is a grain count. If there is one (or two) operand of the full floating-point value, the fractional portion is retained and the result is a floating-point number.
Type conversions:
1. The conversion of long type to short type, using the method of direct truncation;
2. Short-to long-type conversions are performed in two different situations. If the short type is an unsigned integer, the high part of the long type is filled with 0, and if the short type is a signed integer, the long type of the high part fills the symbol bit of the type.
Use aliases:
Redefine some types to prevent differences in the number of types of bytes produced due to different platforms and compilers, which facilitates portability.
1typedef unsignedCharBoolean/*The Boolean value type.*/ 2typedef unsignedLong intUInt32;/*Unsigned-bit value*/ 3typedef unsigned ShortUInt16;/*Unsigned-bit value*/ 4typedef unsignedCharUint8;/*Unsigned 8 bit value*/ 5typedef signedLong intInt32;/*signed-bit value*/ 6typedef signed ShortInt16;/*signed-bit value*/ 7typedef signedCharint8;/*signed 8 bit value*/