online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> class CVector { public: int x, y; CVector() {}; CVector(int a, int b) :x(a), y(b) { std::cout<<"paremterized ctor used"<<std::endl; } }; CVector operator- (const CVector& lhs, const CVector& rhs) { return CVector(lhs.x - rhs.x, lhs.y - rhs.y); //this uses the parameterized ctor } int main() { CVector foo(2, 3); CVector bar(3, 2); CVector result; result = foo - bar; std::cout << result.x << ',' << result.y << 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