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 Derived *clone() const override { std::cout << "Derived::clone()\n"; return new Derived(*this); } }; void process(Base *b) { Base *a = b->clone(); a->execute(); delete a; } int main() { Derived d; process(&d); }

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