title: c++, how to verify is the data input is of the correct datatype
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3273993/how-do-i-validate-user-input-as-a-double-in-c">how do I validate user input as a double in C++?</a>  </p>
  </blockquote>
  
  
  
  <p>I am new to C++, and I have a function in which I am wanting the user to input a <code>double</code> value. How would I go about insuring that the value input was of the correct datatype? Also, how would an error be handled? At the moment this is all I have:</p>
  
  <pre><code>if(cin &gt;&gt; radius){}else{}
  </code></pre>
  
  <p>I using `try{}catch(){}, but I don't think that would the right solution for this issue. Any help would be appreciated.</p>