title: Conversion of string to stack-int-value, when is negative, results in strange value
body: <p>I'm trying to convert my string of numbers in a stack, but I don't understand why when the number is negative, the first element is always <code>-3</code>. </p>
  
  <pre><code>void Soma::StrToInt(char str1[], char str2[]) {
      for (int i = 0; str1[i] != '\0'; i++) {
          if (str1[0] == '-') {              //if is negative
              negative1 = true;
          }
          p1.push(str1[i] - '0');
          cout &lt;&lt; p1.top() &lt;&lt; endl;//Always showing the first element == -3
      }
  
      for (int i = 0; str2[i] != '\0'; i++) {
          if (str1[0] == '-') {
              negative2 = true;
          }
          p2.push(str2[i] - '0');
      }
  }
  </code></pre>
  
  <p>The full code is too big to post here, the problem is why this <code>-3</code> value appears, when my string is negative, like <code>-500</code>, <code>-9514897654654</code> or any negative number.</p>
  
  <p>Minimal version:</p>
  
  <pre><code>int main() {
      char str1[] = { '-','4','0','0' };
      stack&lt;int&gt; p1;
  
      for (int i = 0; str1[i] != '\0'; i++) {
          p1.push(str1[i] - '0');
          cout &lt;&lt; p1.top() &lt;&lt; endl;
          p1.pop();
      }
  }     
  </code></pre>