Possible Duplicate:
What's this C++ syntax that puts a brace-surrounded block where an expression is expected?
I've just come across this strange C/C++ syntax:
#include <stdio.h> int main() { printf("%s", ({ static char b__[129]; b__[0] = 55; b__[1] = 55; b__[2] = 0; b__; }) ); }
This compiles and runs fine using both gcc and g++ (4.5.2). This is the first time I see something like this, and I wonder what exactly this syntax means. I've tried to Google it, but I have no idea what this construct is called.
They're called statement expressions, it's a GNU extension. In your example the result of the expression is b__
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With