Re: Equivalence


[ Follow Ups ] [ Post Followup ] [ CS2604 Discussion WWWBoard ] [ FAQ ]

Posted by hussein on August 04, 1999 at 15:49:32:

In Reply to: Equivalence posted by Paradox on August 04, 1999 at 15:36:56:

: Is:
:


: for (int i=0; (i<10) && (test); i++) {
: do_something();
: }
:

: the same as:
:

: for (int i=0; i<10; i++) {
: if (test) do_something();
: else break;
: }
:

no.

in the first case, as soon as test fails, the loop terminates.

in the second case, the loop continues even after test fails for the first time.

---

hussein


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2604 Discussion WWWBoard ] [ FAQ ]