N
novickivan
Hello,
What does this print:
printf("%d\n", 3 ?: 4);
For me it seems to print the number 3. It seems the expression says
if the first expression is true than use the second expression as the
result. But if there is no second expression than use the first
expression.
I don't see this syntax (with the missing second expression)
referenced in the C language standard, so I was wondering if this is
official C language syntax?
Cheers,
Ivan Novick
What does this print:
printf("%d\n", 3 ?: 4);
For me it seems to print the number 3. It seems the expression says
if the first expression is true than use the second expression as the
result. But if there is no second expression than use the first
expression.
I don't see this syntax (with the missing second expression)
referenced in the C language standard, so I was wondering if this is
official C language syntax?
Cheers,
Ivan Novick