1.1基本类型
1)基本内置类型
![](https://img-blog.csdnimg.cn/img_convert/92bdad7114daea63dae7ee3fa6ffc3f6.png)
![](https://img-blog.csdnimg.cn/img_convert/3ee271d426bfb664ed84efc66dbbd08b.png)
![](https://img-blog.csdnimg.cn/img_convert/adf8fd6e8175b4e8ce25367ab63c9761.png)
![](https://img-blog.csdnimg.cn/img_convert/d9994367c27840ba54036bd10c2a94db.png)
字面量 -1(默认为int)转化为unsigned char无符号类型 : char为8比特,2^8 - 1 = 255
字面量 -42(默认为int)转化为unsigned int无符号类型 : int为32比特,2^32 - 42 = 4,294,967,254
![](https://img-blog.csdnimg.cn/img_convert/8550ca0497793cf93f553d9368ef62db.png)
unsigned int u1=10, u2=42, u1-u2=-32, -32要转化为无符号类型,2^32 - 32 = 4,294,967,264
浮点型字面量3.1415926(默认为double)
![](https://img-blog.csdnimg.cn/img_convert/714e9bf4f59847271d9c6e693723433d.png)
![](https://img-blog.csdnimg.cn/img_convert/ec0730f4bae5b0823d05e5567dbd7d70.png)
![](https://img-blog.csdnimg.cn/img_convert/40972e5b1f027e0d02fd3b85de87f54f.png)
用cout输出字符串,遇见\0(空字符)就结束了
![](https://img-blog.csdnimg.cn/img_convert/9dd67ed350ce284c3937b7e561032c73.png)
true和false为布尔字面值
nullptr为指针字面值