说明: 该运算符不仅能用在变量之间,竟然还可以用在函数之间,相当于可传参数的函数调用
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
其中:
(c ? show_1 : show_2)(100);
其实等同于
if (c)
else
另类函数调用,可作参考
说明: 该运算符不仅能用在变量之间,竟然还可以用在函数之间,相当于可传参数的函数调用
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
其中:
(c ? show_1 : show_2)(100);
其实等同于
if (c)
else
另类函数调用,可作参考