- 1

What does '?' and ':' mean in C++??

24th Sep 2017, 3:33 PM
Prateek Gupta
Prateek Gupta - avatar
2 odpowiedzi
+ 5
It's called the ternary operator and it's basically if/else. x = condition ? a : b; is the same as if(condition) x = a; else x = b;
24th Sep 2017, 3:48 PM
Schindlabua
Schindlabua - avatar
0
thanks a lot bro!!
24th Sep 2017, 4:37 PM
Prateek Gupta
Prateek Gupta - avatar