-3

I would like to be able to convert a string such as "(5+6)*6" and get the resulting integer from that equation. It is important that it starts out as a string.

Tekek
  • 19
  • Check this out : http://www.speqmath.com/tutorials/expression_parser_cpp/index.html – Mert Şeker Feb 27 '16 at 01:48
  • 1
    Possible duplicate of [Equation (expression) parser with precedence?](http://stackoverflow.com/questions/28256/equation-expression-parser-with-precedence) – The_Black_Smurf Feb 27 '16 at 02:37

1 Answers1

3

You can use library fastmathparser for c++. In link is example how use this library.

If you really want write alone this parser, I recomended use Shunting-yard algorithm

Nejc Galof
  • 2,538
  • 3
  • 31
  • 70