0
What is the use of ternary operator in c++?
2 Respostas
+ 8
Another way to write an if else part.
if (x==5)
cout << "howdy";
else
cout << "bye";
equals
cout << (x==5? "howdy": "bye");
+ 3
Its use is to allow using conditions in the middle of a statement