title: cin - reading plus/minus as char
body: <p>I have a problem with the input of my program. It is supposed to input a mathematical expression e.g. <code>( x + 3 + ax - 5)</code>. All items are separated by a white space. </p>
  
  <p>The way I handle this: first I try to read an integer with <code>cin &gt;&gt; number</code>. If it fails, I try to read an array of chars. I then check if this is an operator (<code>+,-,*,/,( or )</code>) - if not, then this must be a variable. </p>
  
  <p>The problem I experience is with the signs of plus and minus. The <code>cin</code>, while reading an integer, seems not to print an error while reading + or -. Is there any way of making this work the way I intend? 
  Thanks in advance and here is my code fragment:</p>
  
  <pre><code>int number; char * signs = new char[3]; char signsBeginning[3] = "aa"; 
  signs = signsBeginning;
  while(#endexpression){ 
       cin &gt;&gt; number;
       if(!cin){
         //not a number
         cin.clear();
         cin &gt;&gt; signs;
         //handling the input
       }else{
         //number
       }
  }
  </code></pre>
  
  <p>EDIT: Forgot to add : I can't use strings.</p>