Ternary Operator | C Programming Tutorial

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

The first time I have be able to clearly read a ternary statement. Many thanks!

I do think I’ll stay with if-then-else statements, however. To me they are mostly much easier to follow, especially when I’m reading another person’s code or old code of my own I haven’t seen in awhile.

Thanks again!

Mnogojazyk
Автор

Underrated channel. Keep up the good work.

harisjobson
Автор

Another usecase:
printf("They are %s/n", a==b?"same":"different");
Note that the test is boolean, but the two expressions can be any type.

Mskvaer
Автор

can ternary operator function with the goto statement ?

such as
--> (a<b)? goto end : a

YapHuanXi