#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; void ucalc_call MyAdd(uCalcBase::Callback cb) { auto x = cb.Arg(1); auto y = cb.Arg(2); cb.Return(x + y); } int main() { uCalc uc; // Link the uCalc function 'Add' to the native 'MyAdd' callback. uc.DefineFunction("Add(x, y)", MyAdd); // Now the native code can be called from an expression. cout << uc.Eval("Add(10, 5)") << endl; }