I hasn't understand what compiler does here and why it's working c++ code
#include <cstdio>
int main()
{
printf( ({ // (1)
struct some_noize_struct {
// there may be another code
};
42;
"abc";
}) // (2)
);
return 0;
}
Type of expression between (1) and (2) braces is const char*. After some experimens i unrerstood that type of (1)-(2)-expression determined by last part.
Here is a sample code. It works on c++11 and later. http://cpp.sh/5tb47
My question: how it works.