A basic data:
(1)整型: short 至少16 位 int 至少与short长度相同 long 至少32位,至少与int一样长 long long 至少64位,至少与long一样长(2)浮点数: float 至少32位 double 至少48位(主流为64位) long double 至少与double相同
Two data limitations:
Restrictions on data types on different platforms need to be viewed using Limits.h or climits header files
Symbolic constant meaning Char_bit The number of bits of char Char_max the maximum value of char Char_min The minimum value of char Schar_max the maximum value of signed Char Schar_min Signed char minimum value Uchar_max unsigned char maximum Shrt_max short Type maximum value shrt_min short The minimum value of the type Ushrt_max the maximum value of the unsigned short type Int_max The maximum value of the integral type Int_min the minimum value of the integer Unit_max Maximum value of the unsigned integer long_max LONG long_minThe minimum value of long ulong_max the maximum value of the unsigned long Llong_max The maximum value of long long llong_min the minimum value of long long Ullong_max Unsigned long Long's maximum value PS: see/usr/include/limits.h for more details
Three data suffixes:
To explicitly declare the type of a constant, you add a suffix at the end of the constant, and the type of the default constant is int
L : long (对于double 使用L) U : unsigned LL: long long F: float
Four about coercion type conversions:
c 类型形式: (type) var_or_const c++ 形式: type ( var_or_const ) c++ 形式: static_cast<type>( var_or_const)
Basic data types for C + +