fork(1) download
  1. #include <iostream>
  2.  
  3. enum trafficlights {red,yellow,green};
  4.  
  5. int main(int argc, char* argv[])
  6. {
  7. trafficlights light = red;
  8.  
  9. std::cout << light << " " << green << std::endl;
  10. if (light ==2) { //Not exactly type safe!
  11. std::cout << "Light is green" << std::endl;
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
0 2