[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Let's talk about order of assignment
- From: Tim Hill <drtimhill@...>
- Date: Mon, 15 Sep 2014 22:41:45 -0700
On Sep 15, 2014, at 3:48 AM, Axel Kittenberger <axkibe@gmail.com> wrote:
> I don't get it? How about, just don't do it? Why should anybody ever do that?
>
> Altough its not as easy to shoot ones foot with modern high level languages, in almost all of them it is still possible to create code with ill-defined behavior.
>
> ( I welcome the collection of ill-defined ways to code for academic interests, its sometimes not too easy to find how to. But other than that, who cares? )
>
> PS: Almost any language has ill-defined behavior by calling a sort with a custom comparator where for example a > b, b > c, c > a
>
Indeed. One of my interview questions for a C applicant is:
int k = 1;
k = k++ + ++k;
What is the value of k?
—Tim