ary*_*rya 4 c macros anonymous-function parentheses
这样的陈述是什么意思?
int x = ( { int a; scanf( "%d", &a ); a ; } ) ;
Run Code Online (Sandbox Code Playgroud)
它编译并运行相当于:
int x;
scanf( "%d", &x );
Run Code Online (Sandbox Code Playgroud)
它似乎像某种匿名函数调用或其他东西,但我不确定.我没有遇到像({})以前那样的陈述,我无法在网上找到任何解释.任何帮助将非常感谢,谢谢:)
语境:
这是扩展以下代码中的宏时获得的代码:
#define SI ({int a;scanf("%d",&a);a;});
int x = SI;
Run Code Online (Sandbox Code Playgroud)
这是编程竞赛中某人使用的代码.