title: searching cstring for operators
body: <p>For an assignment we are given an equation in reverse polish notation. For this example I will use: <code>2 3 8 * + $</code>  The <code>$</code> is for denoting the end of the expression. Using a stack, we output the answer.</p>
  
  <p>I have been using:</p>
  
  <pre><code>getline(cin, input, '&amp;');
  input.c_str();
  </code></pre>
  
  <p>to read in the equation and then turn it into a c_string so I can look at the individual elements in the input.</p>
  
  <p>After, I need to check for a few things.  If the element is a digit I need to push it onto the stack.  If it is white space I need to skip over it.</p>
  
  <pre><code>if (isdigit(input[i]))
  {
      push();
      i++;
  }
  else if (isspace(input[i]))
  {
      i++;
  }
  </code></pre>
  
  <p>Now is what has me stuck.  If I hit an operator (in this case <code>*</code>) I need to pop the top two elements off the stack and 'operate them' and push the result back to the stack.  However, I don't know of anything that would allow me to recognize that they are operators. It is probably a silly question, but help would be greatly appreciated.</p>