Re: for conditional handling question
- From: Willem <willem@xxxxxxxxxxxxxxx>
- Date: Sun, 2 Jan 2011 22:27:51 +0000 (UTC)
sandeep wrote:
) Eric Sosman writes:
)> In other words, a "for" statement does:
)>
)> 1: If `e1' is present, evaluate it. (And bring into existence
)> any variables it happens to declare These variables live as
) long as
)> the loop is executing, and cease to exist when it terminates
) for any
)> reason.)
)>
)> 2: If `e2' is present, evaluate it. If it evaluates to zero,
)> terminate the "for" and skip to whatever follows the body.
)
) I believe it is more correct to say that e1 and e2 are evaluated whether-
) or-not they are empty. It just happens that evaluating an empty
) expression has no effect and yields a TRUE value.
You believe wrongly. As an example:
if () { /* something */ }
The ability to not have expressions is quite specific to for-loops.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
.
- Follow-Ups:
- Re: for conditional handling question
- From: Seebs
- Re: for conditional handling question
- References:
- for conditional handling question
- From: Angus
- Re: for conditional handling question
- From: Eric Sosman
- Re: for conditional handling question
- From: sandeep
- for conditional handling question
- Prev by Date: Re: Where to download C99 Standard
- Next by Date: Re: for conditional handling question
- Previous by thread: Re: for conditional handling question
- Next by thread: Re: for conditional handling question
- Index(es):
Relevant Pages
|