online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> class Test{ static int c; public: Test(){ ++c; std::cout << "Constructed: " << c << std::endl; } ~Test(){ std::cout << "Destructing: " << c << std::endl; this->close(); // gọi close trong hàm hủy. std::cout << "Destructed: " << c << std::endl; } void read(){ std::cout << "read something in " << c << std::endl; } void close(){ std::cout << "closed: " << c << std::endl; } }; int Test::c = 0; void func(){ Test t; t.read(); // t.close(); // tự động bị hủy khi ra khỏi hàm. } int main() { func(); // 1 func(); // 2 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