online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> using namespace std; class Demo { private: int x = 56; protected: int y = 27; public: int z = 67; int getX() { return x; } }; class PublicInheritance : public Demo { public: int getY() { return y; } }; int main() { PublicInheritance sam; cout << "Private member = " << sam.getX() << endl; cout << "Protected member= " << sam.getY() << endl; cout << "Public member= " << sam.z << endl; 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