I’ve found the shunting yard algorithm, but it feels like case is a little bit different.
What if the formula your entering has variables that you want to use in another formula
you enter
cout<<"enter string"<<endl;
cin>>f;
and you enter f as
3 * (X*X) + 2*X + 7
and you use that string and parse it to find the root, for example.
While it is hard to understand what you are looking for, it hints at the ability to evaluate strings as formulas. If your looking for an Eval like solution, take a look at nCalc. Stealing from their webpage:
It also allows you to use parameters, like
and then use X as part of your string to evaluate.
It let’s you convert a string representing a formula into it’s final value. If you are not asking about interpreting strings at formulas then I am at a loss for what you are asking. I recommend revising your question to better articulate the inputs and outputs of your proposed functionality.