#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; // Create a new Expression object with an initial formula. // This uses the default uCalc instance for context. uCalc::Expression expr("1 + 1"); // Implicitly calls .EvaluateStr() when used in a string context cout << "Initial value: " << expr << endl; // Reassign the expression to a new formula with a simple string assignment. // This implicitly calls .Parse() behind the scenes. expr = "10 * (5 + 3)"; // Retrieve the result. For numeric results, you can assign it // directly to a double. This implicitly calls .Evaluate(). double result = expr; cout << "New value: " << result; }