title: Input Validation of int C++
body: <p>I basically want to validate that I have an int and not a floating point number. What I currently have is:</p>
  
  <pre><code>int den1;
  cout &lt;&lt; "Enter denominator of first fraction" &lt;&lt; endl;
  cin &gt;&gt; den1;
  while (den1 == 0){
     cout &lt;&lt; "Enter a non-zero denominator" &lt;&lt; endl;
     cin &gt;&gt; den1;
  }
  </code></pre>
  
  <p>Is there a "test" to generate a boolean value for den1 == int? I'm trying to avoid using getline() because I don't want to use a string if it isn't necessary.</p>