online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include "MyOS.h" #include "Phone.h" #include "System.h" int main() { MyOS os; Phone myPhone(&os); myPhone.start(); return 0; }
#pragma once #include "System.h" class Phone { public: Phone(System* psystem):system(psystem){ } void start() { system->start(); } private: System* system; };
#pragma once #include <iostream> #include "System.h" class MyOS: public System { public: // Override public: void start() override { //override keyword added here to make the intention clear std::cout << "Booting MyOS..." << std::endl; } };
#pragma once #include <iostream> class System { public: public: virtual void start() { std::cout << "Booting System..." << std::endl; } };

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