online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
//forward declare f void f(); struct X { friend void f() { // friend functions can be defined in the class // this does NOT serve as a declaration, even though this is already a definition // to use this function, another declaration is REQUIRED } friend X operator+(const X & x1, const X & x2) { // this stuff serves as declaration somehow return {x1.v + x2.v}; } void foo() { f(); // ERROR: no declaration for f X tmp = X {1} + X {2}; // CORRECT } int v; }; int main() { 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