swap(x,y)

Maarten Litmaath maart at cs.vu.nl
Wed Aug 23 18:34:02 AEST 1989


jsb at advdev.LBP.HARRIS.COM (FLEA) writes:
\In article <8350 at boring.cwi.nl> tromp at piring.cwi.nl (John Tromp) writes:
\:		 (Timothy R. Gottschalk) writes:
\...
\:>       x += y;
\:>       y = x - y;
\:>       x -= y;
\...
\:x^=y^=x^=y;
\...
\Sorry, folks, both of these are illegal if x and y are pointers.

Or if they're structs! :-)
-- 
"rot H - dD/dt = J, div D = rho, div B = 0, |Maarten Litmaath @ VU Amsterdam:
  rot E + dB/dt = 0" and there was light.   |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.lang.c mailing list