prev up next top/contents search

comp.lang.c FAQ list · Question 11.35

Q: People keep saying that the behavior of i = i++ is undefined, but I just tried it on an ANSI-conforming compiler, and got the results I expected.


A: A compiler may do anything it likes when faced with undefined behavior (and, within limits, with implementation-defined and unspecified behavior), including doing what you expect. It's unwise to depend on it, though.

Here is another way of looking at it, due to Roger Miller:

``Somebody told me that in basketball you can't hold the ball and run. I got a basketball and tried it and it worked just fine. He obviously didn't understand basketball.''

See also questions 7.3b, 11.32, 11.33, and 11.34.


prev up next contents search
about this FAQ list about eskimo search feedback copyright

Hosted by Eskimo North

AltStyle によって変換されたページ (->オリジナル) /