In C++ you have two options, first and easiest is that you evaluate
not that string, but fetch the needed operations from the UI and calculate it. (Get the numbers and operators from the button input) or you must parse the string data for numbers and operators yourself and than work it out. I found the
DescCalc project on Github. But be aware: it may be too complex for your needs.
I would write a parser which is evaluate the input string to numbers and operators. Respect the rules of math like for:
a * b + c
(a + b) * c