TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: BOB STOUT
from: NEIL HELLER
date: 1998-02-13 19:46:00
subject: MEMORY EXCHANGE

BS> >   a^=b^=a^=b;
BS>  > but don't, it confuses people :^)
 
BS> Jasen...
 
BS>   Since order of evaluation isn't guaranteed in C, this is bogus. You 
ust
BS> instead use:
 
BS>         a ^= b;
BS>         b ^= a;
BS>         a ^= b;
 
BS>   The semicolons are the required sequence points missing from your 
approach.
BS> IOW, it may or may not work, depending on your particular
BS> compiler.
Would it be OK to go:  (((a ^= b)^= a) ^= b);
Doesn't a compler guarantee to perform the action of the inner-most
parens first?
 * KWQ/2 1.2i *
--- FLAME v1.1
---------------
* Origin: Port Chicago's Loading Dock - 510-676-5359 (1:161/204)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.