Was bedeutet diese Zeile
-
Bin grad über diese Zeile gestolpert
x= (y<0) ? z : y;
Was bedeutet das?
-
Das wenn y<0 x=z sonst x=y
-
Danke !
-
Das ist die Darstellung des ternären Operators in c.
A ternary expression consists of three operands joined by the conditional-expression operator.
test ? statement1 : statement2
Arguments
test
Any Boolean expression.
statement1
A statement executed if test is true. May be a compound statement.
statement2
A statement executed if test is false. May be a compound statement.Schau mal hier
http://www.c-plusplus.net/forum/viewtopic.php?t=9220&highlight=trin%E4re