Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

New answers tagged

2 votes
Accepted

Advanced String Calculator with asin, acos, atan Functions in C++

It is inefficient Your code is very inefficient for various reasons. First, StringCalculator itself only handles braces. It finds the innermost braces, then uses <...
G. Sliepen's user avatar
  • 56.9k
4 votes
Accepted

Advanced String Calculator in C++

Great that you have incorporated all review comments! This is not a complete review (I may get back to it if time permits), but there are two things that caught my eye. The parser: You continue ...
MrBean Bremen's user avatar
4 votes

String Calculator in C++

Bug in processing: Power expressions are processed from left to right. 2^3^2 This should be processed as: 2^(3^2) Your code will do it the wrong way: (2^3)^2 But the fix is simple: ...
Martin York's user avatar
  • 95.2k
5 votes
Accepted

String Calculator in C++

A few suggestions (got too long for a comment): don't do the calculation in the constructor, but only when the result is needed (lazily) Do you need a separate method to remove leading and trailing ...
MrBean Bremen's user avatar

Top 50 recent answers are included