Jump to content


Check out our Community Blogs

MeTh0Dz

Member Since 28 May 2008
Offline Last Active May 08 2018 03:49 PM
-----

Blog Entries

MeTh0Dz's Blog > Ternary Operator CPP

Posted 22 June 2008

A ternary operator is an operator that requires three different parameters/arguments. It is basically used to evaluate an if statement.

Example...

(x == 10) ? (cout << "X equals 10") : (cout << "X does not equal 10");


Basically this says, if x equals ten then print the first message, else print the second message. So it...


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download