TIP: Click on subject to list as thread! ANSI
echo: nthelp
to: John Beckett
from: Tony Williams
date: 2004-11-21 13:19:10
subject: Re: C++ for beginners?

From: Tony Williams 

John Beckett wrote:
> "Geo"  wrote in message
news::
>
[snip]
> Sounds a bit weird to me. The following is part of C lore:
>
> void swap(int x, int y)
> {
>     int temp = y;
>     y = x;
>     x = temp;
> }

Shameless waste of stack space!

void swap (int &x, int &y)
{
     x ^= y ^= x ^= y;
}

There, that's much harder to understand 

--
Tony

--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270 5030/786
@PATH: 379/45 1 396/45 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

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™.