#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; // Practical (Real World) // Parse an expression auto myExpr = uc.Parse("5 + 4"); cout << "Initial evaluation: " << myExpr.Evaluate() << endl; // Retrieve the parent uCalc instance from the expression object auto parentUc = myExpr.uCalc(); // Use the parent instance to add a new formatting rule parentUc.Format("Result = 'Answer = ' + Result"); // The new format is now active for this expression's context cout << "Formatted evaluation: " << myExpr.EvaluateStr() << endl; }