online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> using namespace std; /* 下面的 add 和 sub,类型都是 int(int, int) */ int add(int a, int b) { return a + b; } int sub(int a, int b) { return a - b; } // 为 int (int, int) 类型的函数,重载流输出操作符 << ostream& operator << (ostream& os, int (f) (int, int)) { os << f(1, 2); // 参数固定为 1,2 return os; } int main() { cout << add << ", " << sub << 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