1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-09-01 02:42:12 +02:00

Put demonstrative condition into ternary expression

It should be made clear that the part before the ternary operator is
indeed a condition, most often created as some comparison expression.
This commit is contained in:
Guntbert Reiter
2015-10-04 16:44:24 +02:00
committed by G. Reiter
parent 38b9bf7eed
commit b1984042c8
4 changed files with 9 additions and 5 deletions

View File

@@ -234,7 +234,8 @@ on a new line! ""Wow!"", the masses cried";
// Üçlü operatörler
// Basit bir if/else ifadesi şöyle yazılabilir
// <koşul> ? <true> : <false>
string isTrue = (true) ? "True" : "False";
int toCompare = 17;
string isTrue = toCompare == 17 ? "True" : "False";
// While döngüsü
int fooWhile = 0;