how can we check to not enter the any string or char?



int n_mines;
printf("How many mines do you want in the minefield?");
scanf("%d", &n_mines);

while(n_mines>100 || n_mines<0)
{
printf("Please only enter between 1 and 100");
scanf("%d", &n_mines);
}

so I dont want to user can enter the string or char value,how can I
check it?

.



Relevant Pages

  • this->*
    ... saw this in - I dont think - did much justice in explaining the ... void RxFunc2; ... void FOO::RxFunc1(const char *, int) ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Nice "bug" to loose a contest
    ... This code works like the python one, ... I dont use buffered stdio f... ... int main ... char buf; ...
    (comp.lang.python)
  • Re: how can we check to not enter the any string or char?
    ... printf("How many mines do you want in the minefield?"); ... so I dont want to user can enter the string or char value, ... ** Bulletproof numeric input with fscanf. ... int main ...
    (comp.lang.c)
  • Re: how can we check to not enter the any string or char?
    ... printf("How many mines do you want in the minefield?"); ... so I dont want to user can enter the string or char value, ... int main ... Chqrlie. ...
    (comp.lang.c)
  • Need faster bitmap compare method
    ... I dont think my first one went through. ... region size im scanning is 128x96 on a 1024x768 bitmap. ... int curx = 0; ... newy = CheckY; ...
    (microsoft.public.dotnet.framework.drawing)