Confused by syntax

how is:


different from this:


any comment?
In the first case you're reading from wr and writing to wr without synchronization. If wr is a scalar (for
example, a double or an int), the program has undefined behavior, anything can happen. If it's a class object, there are two equally correct possible outcomes.

Your second code sample is well-defined and thus can be reasoned about.

If you're not familiar with expression evaluation rules, check out
Last edited on
sorry...should have read:


how is that different than the 2 lines from above?
Last edited on
Those are the same for built-in operators (assuming temp is supposed to be wtemp). What caused the doubt?
I thought they were...not familiar with C++ so i wasn't sure if this did a different order of ops...

thanks for the feedback.
Topic archived. No new replies allowed.