c++数据类型
基本内置类型
[*]算术类型(整型[包括字符和布尔类型]和浮点型)
[*]空类型(void)
非基本数据类型
数组 type [ ] ---type表示非空数据类型
指针 type *
结构 struct.
联合 union
枚举 enum
类 class
字面值常量
[*]十进制字面值常量是带符号的,类型是int、long和long long中尺寸最小那个
[*]类型short没有对应的字面值
[*]默认浮点数字面值是一个double
[*]字符串字面值常量的类型是const char *
指定字面值的类型 前缀:
[*]u char16_t
[*]U char32_t
[*]L wchar_t
[*]u8 char(utf8编码)
后缀:
[*]u or U unsigned
[*]l or L long
[*]ll or LL long long
[*]f or F float (浮点型字面值)
[*]l or double (浮点型字面值)
其他:
[*]true 和 false 是 布尔型字面值
[*]nullptr 是 指针字面值
文档来源:51CTO技术博客https://blog.51cto.com/u_11992402/3014549
页:
[1]