title: Distinguishing if int or char / string from user input
body: <p>I'm trying to read input from the user.
  I'd like to distinguish if the input provided is an int, a char or string.</p>
  
  <p>I tried approaching this with scanf_s, but this didn't quite work. Is there a way to take input from the user, and tell if this is an integer, char, or string?</p>
  
  <p>This is what I had so far. </p>
  
  <pre><code>void CheckIfInt()
  {
    char returnValue = 0;
  
    //loop until we are given a valid input
    while(true)
    {
      scanf_s("%c", &amp;returnValue);
      scanf_s("%C");
  
      if(isdigit(returnValue))
      {
        //Do something
        break;
      }
  
      else if(returnValue == 'a')
      {
        //Do something else
        break;
      }
    }
  }
  </code></pre>