title: Correct way of using isDigit() function in c++
body: <p>I am new to C++ and I have studied some basics of C language. Here's my code snippet.</p>
  <pre><code>#include &quot;iostream&quot;
  
  using namespace std;
  
  int main() {
      int a=108;
      if(!isdigit(a)) {
          cout&lt;&lt;&quot;The number is not a digit&quot;;
      }
      else
          cout&lt;&lt;&quot;It's a Number!&quot;;
      }
  }
  </code></pre>
  <p>I dont know why, but it satisfies the condition. It should have outputted, <code>It's a Number!</code> Please correct me and also if u have a better solution to this, do suggest! (To make it more clear) I want to check whether the entered int is actually composed of digits. Thank you</p>