online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <functional> class Abstract { public: void foo() { auto func = std::bind(&Abstract::virtualFoo, this); func(); } protected: virtual void virtualFoo() = 0; }; class Derived1 : public Abstract { private: void virtualFoo() override { std::cout << "I am Derived1\n"; } }; class Derived2 : public Abstract { private: void virtualFoo() override { std::cout << "I am Derived2\n"; } }; int main(int argc, char *argv[]) { Abstract * a1 = new Derived1; Abstract * a2 = new Derived2; a1->foo(); a2->foo(); 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