Re: [cc65]Unusuall?

Date view Thread view Subject view

From: Mirco Miranda (mircomir_at_libero.it)
Date: 2001-01-02 20:35:39


Spiro Trikaliotis ha scritto:

> Hello,
>
> > Or, better,
> >
> > while ((c = *value) != 39 && c != 62) {
> > <stuff>
> > }
>
> Forgive me, but if my memory serves me right, C (at least pre-ANSI) does NOT
> define the order in which this will be evaluated, so the second part (c!=62)
> might be evaluated BEFORE the first part with the assignment, in that case,
> this will NOT evaluate to the expected condition.

scuse me... probably I don't understand very well (I have some problem with english:-()),
but C work in corto-circuit when it evaluate a boolean expression.
In this case, it elaborate the first part (the part before the &&) and then (only if this is
TRUE) it check the second part otherwise (if the first part is FALSE) the result of boolean
expression is FALSE.

In all things I prefer to use the "for" instead the "while" when I write a C program...

--

ciao, Mirco.

ICQ#: 51640305


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:37 CET