(C++) Questionmark-colon operator
February 24, 2017 · View on GitHub
(C++) Questionmark-colon operator
The questionmark-colon operator is an operator to perform simple if-statements.
#include <cstdlib> int main() { const int i = std::rand(); const bool odd = (i % 2 == 1 ? true : false); }