C++ check whether is number is int/float
<p>i'm new here. i found this site on google.</p>

<pre><code>#include &lt;iostream&gt;

using namespace std;

void main() {

    // Declaration of Variable
    float num1=0.0,num2=0.0;

    // Getting information from users for number 1
    cout &lt;&lt; "Please enter x-axis coordinate location : ";
    cin &gt;&gt; num1;

    // Getting information from users for number 2
    cout &lt;&lt; "Please enter y-axis coordinate location : ";
    cin &gt;&gt; num2;

    cout &lt;&lt; "You enter number 1 : " &lt;&lt; num1 &lt;&lt; " and number 2 : " &lt;&lt; num2 &lt;&lt;endl;
</code></pre>

<p>I need something like, when users enter alphabetical characters, it would display an error says, you should enter numbers.</p>

<p>Any help greatly appreciated </p>
