online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> class Base { public: virtual ~Base() = default; virtual void execute() const { std::cout << "Base::execute()\n"; } virtual Base *clone() const { std::cout << "Base::clone()\n"; return new Base(*this); } }; class Derived : public Base { public: virtual void execute() const override { std::cout << "Derived::execute()\n"; } virtual void apply() const { std::cout << "Derived::apply()\n"; } virtual Derived *clone() const override { std::cout << "Derived::clone()\n"; return new Derived(*this); } }; int main() { Derived d1; // ... Derived *d2 = d1.clone(); // ... d2->execute(); // ... d2->apply(); // ... delete d2; }

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