online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> class Person { public: // The ownership is outside the class. Person(const std::string* name) : name_(*name) {} const std::string& GetName() const { return name_; } private: const std::string& name_; }; std::string GetString() { return "A string"; } int main() { Person person(&GetString()); // Error: taking address of temporary [-fpermissive] std::cout << person.GetName(); }

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