Ad
  • Default User Avatar

    Yes, it's the conditional statement in C/C++: a ? b : c has the value b if a is true, and c if a is false. But it is possible that c is another statement of the same kind, so e.g. a ? b : x ? y : z has the value b if a is true, y if a is false but x is true, and z if a and x are both false. Similiarly, z could be yet another conditional statement, and so on. No parentheses are required, and the source code can be formatted as in this solution, so it looks like a list of conditions to be checked and corresponding values to take. Java and Javascript both allow this syntax too.

  • Custom User Avatar

    Automatic type choice. These are all valid:

    auto a = "sss";      <--  stores string
    auto b = 123;        <--  stores integer
    auto c = 123456789;  <--  stores long