title: Double.parseDouble() equivalent in C++?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1012571/stdstring-to-float-or-double">std::string to float or double</a>  </p>
  </blockquote>
  
  
  
  <p>I am writing a calculator (learning C++), and just decided to make a calculator, since that was the first thing I did when learning Java.</p>
  
  <p>The program does the following:</p>
  
  <ol>
  <li>Asks the user for the first number</li>
  <li>Asks what the user wants to do with the number (-,+,*,/)</li>
  <li>Asks for the second number</li>
  <li>Displays the result.</li>
  </ol>
  
  <p>when grabbing a number from the user in Java I used Double.parseDouble(number) to check if what they entered is a number or not.</p>
  
  <p>Is there a similar command in C++? Ive been doing research and it seems like you have to use tricks such as comparing it to ASCII equivalents etc.. basically a ton of code for a simple task... so before i take that route, I wanted to stop by here and see if perhaps there is some sort of call I can make to check if the input is a number. I need it to validate negatives, zero and positives, as well as numbers with decimals... everything else should be rejected and the user should be asked for input again.</p>
  
  <p>When I did it in Java I used try/catch statement and if the input was invalid it would return the method (in other words, itself) so it would loop and ask the user for input again.</p>
  
  <p>Thanks!</p>