Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9030

Re: A freshman's question

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Travers Naran <tnaran@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: A freshman's question
Date Thu, 20 Oct 2011 07:30:31 -0700
Organization A noiseless patient Spider
Lines 18
Message-ID <j7pbaa$92n$1@dont-email.me> (permalink)
References <3242b80f-ee51-45f0-9e12-231482f61a97@r2g2000prh.googlegroups.com> <37KdnWZAYfIR1QPTnZ2dnUVZ_vWdnZ2d@earthlink.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Thu, 20 Oct 2011 14:30:34 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="tyezmVsV8/Iz8tdpI+Szpw"; logging-data="9303"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189V1AGiDcW/7sbUS8Z+QyV"
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
In-Reply-To <37KdnWZAYfIR1QPTnZ2dnUVZ_vWdnZ2d@earthlink.com>
Cancel-Lock sha1:ZQ9gQVDYDytEwcOm348SgIPrm9o=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9030

Show key headers only | View raw


On 18/10/2011 8:48 PM, Patricia Shanahan wrote:
>
> The i=i++ operation sequence is:
>
> 1. Evaluate i++. It has the side effect of incrementing i to 1, but has
> as result the old value of i, 0.
>
> 2. Do the assignment. This sets the left hand side, i, equal to the
> result of the right hand side, 0.
>
> In theory, i does change to 1, but immediately changes back to 0. In
> practice, the change in i's value might get optimized out. The effect of
> i=i++ is to leave i unchanged.

This is off topic, but I just recently learned that in C++, the result 
of i=i++ is officially undefined.  It's interesting a question related 
to what I learned comes up again in a completely different forum.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-18 20:08 -0700
  Re: A freshman's question Patricia Shanahan <pats@acm.org> - 2011-10-19 04:48 +0100
    Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-19 00:54 -0700
      Re: A freshman's question Patricia Shanahan <pats@acm.org> - 2011-10-19 09:20 +0100
        Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-19 03:38 -0700
          Re: A freshman's question Lars Enderin <lars.enderin@telia.com> - 2011-10-19 17:48 +0200
            Re: A freshman's question Tim Slattery <Slattery_T@bls.gov> - 2011-10-19 12:24 -0400
              Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-20 03:55 -0700
            Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-20 03:50 -0700
          Re: A freshman's question Lew <lewbloch@gmail.com> - 2011-10-19 09:58 -0700
            Re: A freshman's question Patricia Shanahan <pats@acm.org> - 2011-10-19 18:47 +0100
            Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-20 03:48 -0700
        Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-19 03:49 -0700
          Re: A freshman's question Patricia Shanahan <pats@acm.org> - 2011-10-19 18:58 +0100
            Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-20 02:13 -0700
      Re: A freshman's question Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-10-19 06:05 -0300
        Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-19 03:38 -0700
    Re: A freshman's question Travers Naran <tnaran@gmail.com> - 2011-10-20 07:30 -0700
      Re: A freshman's question Gene Wirchenko <genew@ocis.net> - 2011-10-20 10:08 -0700
        Re: A freshman's question Patricia Shanahan <pats@acm.org> - 2011-10-20 18:22 +0100
        Re: A freshman's question Lew <lewbloch@gmail.com> - 2011-10-20 13:59 -0700
        Re: A freshman's question Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-10-20 17:38 -0500
  Re: A freshman's question Roedy Green <see_website@mindprod.com.invalid> - 2011-10-19 23:56 -0700
    Re: A freshman's question whl <wanghailunmail@gmail.com> - 2011-10-20 03:55 -0700

csiph-web