Infix expression calculation C++ implementation