title: Calculator with bracket in C++
body: <p>I'm implementing a calculator in C ++ that respects the priorities of parentheses. I am trying to use <code>std :: string :: find_last_of</code> to find the last occurrence of <code>(</code> and <code>std :: string :: find</code> to find the first occurrence of <code>)</code>. Once that is done, I reckon the content of the extracted substring and continuing with the rest of the string.
  For example:</p>
  
  <pre><code>1 + 1 * (9 * (11-1 + 2))
  </code></pre>
  
  <p>I find the last occurrence of <code>(</code>, the first of <code>)</code> and calculating <code>11-1 + 2</code>. And so it continues.
  Is this the right approach to this problem or is there something better?
  Thank you.</p>