Why ternary operator does not support blocks?
问题 Why the ternary operator does not have blocks? In other words, why the following code does not work and reports error for {} braces? int main() { int i = 1; (i==1)?{printf("Hello\n")}:{printf("World\n")}; return 0; } EDIT Perhaps the question is misunderstood. It was: why blocks are not supported? Why only single expression? Why this is not allowed to work? int main() { int i = 1; (i==1)?{printf("Hello\n");printf("World\n");}:{printf("Bye\n");printf("World\n");}; return 0; } One reason could