#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; double myHostVar = 1234.5; // Bind your C++ host variable to the uCalc variable like this: uc.DefineVariable("myVar", &myHostVar); cout << uc.Eval("myVar") << endl; // The value of the uCalc variable reflects that of the host variable uc.Eval("myVar = 456"); // Changing the uCalc variable updates the host variable since they're linked cout << myHostVar << endl; // The change is reflected in the C++ host variable myHostVar = 9876; // The uCalc variable will reflect this host variable change cout << uc.Eval("myVar") << endl; auto expr = uc.Parse("myVar * 10"); for (myHostVar = 1; myHostVar <= 5; myHostVar++) { cout << expr.Evaluate() << endl; } }