c++ - Can you help me break down what this code is actually doing? if ((a = b > c ? d : e) == e) a++; -
int = 2, b = 3, c = 5, d = 4, e = 1; if ((a = b > c ? d : e) == e) a++;
the answer a=2
i not understand doing.
can me figure out block of code step step?
if ((a = b > c ? d : e) == e) a++;
equals to:
if (b > c) = d; else = e; if (a == e) a++;
also have at: what '?' in c++?
Comments
Post a Comment