online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include<iostream> class Sample { int id; public: Sample(){ id = 1;} //default constructor with empty body Sample(Sample &t) //copy constructor { id=t.id + 1; } void display() { std::cout<< std::endl<<"ID="<<id; } }; static Sample *obj1 = new Sample(); int main() { std::cout << "\nobj1 - heap"; obj1->display(); Sample* obj2 = new Sample(*obj1); std::cout << "\nobj2 - heap"; obj2->display(); Sample obj3(*obj2); std::cout << "\nobj3"; obj3.display(); Sample obj4(obj3); std::cout << "\nobj4"; obj4.display(); obj1= new Sample(obj4); std::cout << "\nobj1 - heap"; obj1->display(); 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