Is easy to calculate a value from a math. formula in c++ if you code it
int x;
result = (x * x) + 3 / 4;
But, what if i wanna READ the function? i mean, if the user gives me a string like:
"(x * x) + 3 / 4"
i want to be able to do calculations with that formula like know the result if "x" is "1.12". I tried to make a library that reads these, but when this starts to be complicated like using "sin" or fractional numbers "3/7". Im thinking about use a program that calls Python to put that in the IDLE and read the result. Is any better way to do this?