标识符与命名规范

基本数据类型之间的运算规则

1.自动类型提升image-20230204165521721

定义的结果变量的范围要大过数值否则就会丢失

整型和浮点型也可以,只要数值在范围内即可

低级往高级做运算应该往高级上去靠,并且整形的范围比浮点型的小

所以结论

image-20230204165529655

image-20230204165533567

char变量和容量小的变量做运算则比较特殊

image-20230204165541775

强制类型转换运算,是自动类型提升的逆运算

在被重定义的数值前加()强转符

损失的小数点称为截断操作

image-20230204165556547

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2023 Langxecho
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信