online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> class Car { public: Car (std::string color) : color_(color) {} std::string getColor() const { return color_; } std::string brand() const { std::string res; //Tesla - color: Black res += type_; res += " - color: " + getColor(); return res; } protected: std::string color_; std::string type_; }; class Tesla : public Car { public: Tesla (std::string color) : Car(color) { type_ = "Tesla"; } }; class Benz : public Car { public: Benz (std::string color) : Car(color) { type_ = "Benz"; } }; int main() { Tesla t1("Black"); std::cout << t1.brand() << std::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