int x = ({
int y = 10, z;
if (2>1) {
z = 11;
}
y+z;
});
x
will be 21. What is this syntax? I've seen it in C and I'm guessing it also exists in C++. Is this standard in either language?
int x = ({
int y = 10, z;
if (2>1) {
z = 11;
}
y+z;
});
x
will be 21. What is this syntax? I've seen it in C and I'm guessing it also exists in C++. Is this standard in either language?
This is a non-standard gcc compiler extension, that lets arbitrary code get executed in an expression context and produce an expression result.