Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(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);
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict