Re: a scanf() question
- From: rlb@xxxxxxxxxxxxxxxxxxxxxx (Richard Bos)
- Date: Tue, 28 Nov 2006 10:15:20 GMT
"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
.
- Follow-Ups:
- Re: a scanf() question
- From: Richard Heathfield
- Re: a scanf() question
- References:
- a scanf() question
- From: Mik0b0
- a scanf() question
- Prev by Date: Re: Reading a string of unknown size
- Next by Date: Re: Reading a string of unknown size
- Previous by thread: a scanf() question
- Next by thread: Re: a scanf() question
- Index(es):
Relevant Pages
|