title: isdigit() in a function
body: <p>I have a function which takes an integer input by the user.</p>
  
  <p>So I have:</p>
  
  <pre><code>scanf("%d, &amp;x);
  </code></pre>
  
  <p>And then, the function:</p>
  
  <pre><code>test(int x);
  </code></pre>
  
  <p>Inside test(), I wanna check if the input is a digit or a character, so I tried:</p>
  
  <pre><code>if (isdigit(x))
      // piece of code
      printf("Done!\n");
  else
      printf("Bye!\n");
  </code></pre>
  
  <p>However, isdigit() does not seem to be working as the program is outputting "Bye!" immediately. What could be the problem?</p>
  
  <p>Thanks.</p>