GCC 代码块求值表达式
2018-12-19 本文已影响13人
YannChee
官方介绍https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html
使用示例:
({
int y = foo ();
int z;
if (y > 0) z = y;
else z = - y;
z;
})
This allows you to use loops, switches, and local variables within an expression
可以在表达式内部使用 循环,判断,局部变量