title: Why can't part of a string be passed onto atoi or stoi?
body: <p>I tried doing this to some substrings which were all natural numbers</p>
  <pre><code>fi = stoi(f[i]) - stoi(s[i]);
  se = stoi(s[i]) - stoi(f[i]);
  </code></pre>
  <p>where f and s are 2 strings. This was solved when I assigned the part of the string to a new variable. I experienced similar stuff with atoi(str.c_str()). Why does stoi and atoi behave like this?</p>