online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> using namespace std; int main() { enum TrafficLight { GREEN, YELLOW, RED }; TrafficLight trafficlight1 = GREEN; // Checking some stuff if (trafficlight1 == TrafficLight::GREEN) cout << "Traffic light is green!" << endl; if (trafficlight1 == TrafficLight::YELLOW) cout << "Traffic light is yellow!" << endl; if (trafficlight1 == TrafficLight::RED) cout << "Traffic light is red! Hold your horses!" << endl; // Add prefixes to the enum names so that they are unique and no naming clashes enum TrainLight { XGREEN, XYELLOW, XRED }; TrainLight trainlight1 = XGREEN; // Checking some stuff if (trainlight1 == TrainLight::XGREEN) cout << "Train light is green!" << endl; if (trainlight1 == TrainLight::XYELLOW) cout << "Train light is yellow!" << endl; if (trainlight1 == TrainLight::XRED) cout << "Train light is red! Hold your horses!" << endl; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue