Cpp again

时间:2023-03-09 04:21:47
Cpp again

1,

Cpp again

2,y = x = a +b

Cpp again

3,字面常量仅仅只作为右值,却不能为左值(常量是右值,由于它的值不能被修改),减法整型变量溢出

Cpp again

signed int ruiy = bigNumber - smallNumber;
cout<<"ruiy is:"<<ruiy<<std::endl;

4,% 取模 循环

Cpp again

5,整型数据类型的除法运输

Cpp again

6,fpermission

Cpp again

Cpp again

7,++,--

++i前缀的语义:先将变量递增,然后再使用.
i++后缀的语义:先使用变量,然后再递增减。

Cpp again

8,if else

Cpp again

9,if (x)  //if x is True (Nonzero)
    x = 0;

(2,) if (x != 0)

  x = 0;

if (!x) //if x is false (zero 0 False,非0 True)
if (x == 0) //if x is zero

if(x)     ==> if(x==0);
if(!x)     ==> if(x==0);
10,

条件三目运算符(3个operator digit)
(expression1)?(expression2):(expression3)
含义:如果expression1为真,则返回expression2的值,否则返回express3

Cpp again

11,

Cpp again

12,

if (条件判断里面不能用=赋值语句)

Cpp again

13,函数默认参数

Cpp again

14,函数重载-多态

Cpp again

15,内联函数

大地部署脚本

Cpp again16,