Interview Questions

People keep saying that the behavior of ...

C Interview Questions and Answers


(Continued from previous question...)

People keep saying that the behavior of ...

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.
``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.''

(Continued on next question...)

Other Interview Questions