title: C++ strings, the string cant contain the plus sign
body: <p>I am trying to make a more advanced calculator where you enter a piece of algebra.
  I have this problem, the string that contains what you inputted doesn't test positive for '+' even when it does.</p>
  
  <p>This is the code that tests the string</p>
  
  <pre><code>for(int i = 0; i &lt; line.length(); i++)
  {
      if(pos == 0 &amp;&amp; line[i] &gt;= '0' &amp;&amp; line[i] &lt;= '9' || line[i] == '.')
      {           
          p1[p1p] = line[i]; // setting the number to the current character
          p1p++; // position of the first number  
      }
      if(line[i] == '+')
      {
      pos++; 
      operation = 1;
      cout &lt;&lt; "add" &lt;&lt; endl;
      }
  }
  </code></pre>
  
  <p>It will never out put + unless there is no space between the last character of the number and the + symbol</p>
  
  <p>e.g. '100+10' would test positive for '+'
  but  '100 + 10' wouldn't.</p>
  
  <p>Thanks -Hugh</p>