The problem I have is that I want to disable the user the possibility of putting character instead of number inside my program and optionally printing the message “it is disabled”. It should ask for the value of the same variable. I tried to do this using this:
scanf(" %[0-9]d",&x);
and this:
else
result = scanf("%*s");
but it still does not work. What should I look for? I’ve searched internet, but I’ve only found solutions for C++ in which cin was used and unfortunately it does not work in C at all.
You can try something like this:
where isAllDigit is: