convert string to equation

I have a string variable that is an equation. I'm trying to evaluate the string to compare compare it to a known integer answer.

The only operators in the string are the 4 basic binary operators that separate each integer value. I am trying to write a bool function that compares the integer answer to the string equation.

Any suggestions on how to write that function would be appreciated.

I was given a hint from a former instructor that there might be a library function that does that or something similar automatically.

*edit* i need to maintain order of operations
Last edited on
Topic archived. No new replies allowed.