C++ one line if else statment code example
Example: single line if c++
a = (x > y) ? z : y;
/* Same as */
if (x > y)
{
a = z;
}
else
{
a = y;
}
a = (x > y) ? z : y;
/* Same as */
if (x > y)
{
a = z;
}
else
{
a = y;
}