Re: a scanf() question



"Mik0b0" <newssw@xxxxxxxxx> wrote:

I have trouble finding a solution to this problem: how to pick up 10
numbers
corresponding to certain criteria (-399>=number<=400) from the input?
The number of input numbers is not limited. Thanks!

You don't. You read numbers from the input (or, if you're wise, you read
strings, and then attempt to convert those to numbers - much less prone
to breakage when someone enters "three" rather than "3"); and _then_ you
check whether the number you read is within the desired limits. There is
no single function in C that can read a number only if it's larger or
smaller than a certain limit.

Richard
.



Relevant Pages

  • Re: Why was the "Symbol is a String"-idea dropped?
    ... Strings and symbols serve different purposes although there is some overlap. ... And I mean not only performance wise but also readability wise. ... IMHO that's mostly an implementation decision in Ruby. ... The core structure must of course be large enough, and a large structure may look impure. ...
    (comp.lang.ruby)
  • Re: Why was the "Symbol is a String"-idea dropped?
    ... Strings and symbols serve different purposes although there is some overlap. ... And I mean not only performance wise but also readability wise. ... IMHO that's mostly an implementation decision in Ruby. ... Given the fact that I don't mix symbols and strings as Hash keys I wouldn't benefit - but it would not hurt me either. ...
    (comp.lang.ruby)
  • Re: The baby face of AGA
    ... Have you noticed how they sound bigger and badder than any other ... As to the strings, 'big and bad' must be positive adjectives amongst ... You were so busy being wise that you ...
    (alt.guitar.amps)
  • Re: new to Perl - please verify my script?
    ... Decide if you are comparing numbers or strings other wise you're going ... to get into trouble. ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Re: The baby face of AGA
    ... Have you noticed how they sound bigger and badder than any other ... As to the strings, 'big and bad' must be positive adjectives amongst ... You were so busy being wise that you ...
    (alt.guitar.amps)