online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include<iostream> #include<string> class Button { public: typedef void (*FuncPtr)(); FuncPtr execute; Button(FuncPtr execute):execute(execute){} }; void CustomCode1(){ std::cout << "Custom Code 1 Worked!" << '\n'; } void CustomCode2(){ std::cout << "Custom Code 2 Worked!" << '\n'; } void CustomCode3(){ std::cout << "Custom Code 3 Worked!" << '\n'; } void CustomCode4(){ std::cout << "Custom Code 4 Worked!" << '\n'; } Button buttons[4] = { {Button(&CustomCode1)}, {Button(&CustomCode2)}, {Button(&CustomCode3)}, {Button(&CustomCode4)} }; int main() { for (int i=0; i<4; i++) { buttons[i].execute(); } 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