4 ms·
Another difference is that C++ allows an assignment expression as third operand of the conditional (ternary) operator: // Valid C++, invalid C c ? 1 :
by nwellnhof 4y ago
Another difference is that C++ allows an assignment expression as third operand of the conditional (ternary) operator:
// Valid C++, invalid C
c ? 1 : x=4
C++ also allows declarations in conditions of selection and iteration statements:
// Valid C++, invalid C
if (int i=3) {}
while (int i=3) {}