I have a little problem with checking my input. I know that there a already similar questions but sincerly it does not solve my problem. I'm already using one of the suggestions from the other questions and it does not work.
#include <iostream>
#include <stdio.h>
#include <ctype.h>
int main ()
{
int a;
printf("Please type in your number: ");
scanf_s("%d", &a);
if(isdigit(a))
{
printf("True.");
}
else
{
printf("False.");
}
std::cin.get();
std::cin.get();
return 0;
}
I don't know what i'm doing wrong but my output is always "False" when i type in a number. When i type in a letter the compiler has an error.