This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bizarre g++ behavior after reinstalling cygwin


<snip>
> "i=i++" is either a no-op or nonsense, depending on the
> interpretation. You should either use "i=i+1" or "i++" (those should
> be equivalent in modern compilers).

The strick interpretation of i=i++ starts by evaluating the right side
"i++" to compute a r-value (right value).  Since the ++ is after the i,
it is a post-operation, vs. if it were before the i, in which case it
would be a pre-operation.   So first the value of i would be saved, then
i incremented, then the saved value would be assigned to the l-value
(left value) which in this case is i, setting i back to its original
value.  You could use "i=++i" which would increment i, then save the r-
value and assign to the l-value, but then again, i++ would be much
simplier, no?

Brett
----------------------------------------------------------------
Brett C. Serkez, Techie


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]