online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> using namespace std; class Base { public: Base(int valor) : x(valor) {} void Mostrar() { cout << x << endl; } protected: int x; }; class Derivada : public Base { public: Derivada(int ivalor, float fvalor) : Base(ivalor), y(fvalor) {} void Mostrar() { cout << x << ", " << y << endl; } private: float y; }; int main() { Derivada *pDer = new Derivada(10, 23.3); Base *pBas; pDer->Mostrar(); // Derivada pBas = static_cast<Base *> (pDer); // pBas = pDer; // Igualmente legal, pero implícito pBas->Mostrar(); // Base delete pDer; 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