Recently, I came across some weird syntax in C code similar to this:
int b = ({
printf("some code");
2;
});
As expected, the code runs and b is set to 2. However, removing the parentheses around the curly braces results in an error:
int b = {
printf("some code");
2;
};
What is this called and how does it work? Why do I need the parentheses?