Re: brain teasers
- From: Martin Ambuhl <mambuhl@xxxxxxxxxxxxx>
- Date: Wed, 04 Apr 2007 14:43:51 -0400
rohitjogya@xxxxxxxxx wrote:
a = a^b;
b = a^b;
a = a^b;
So you know the stupid XOR trick. So what? Don't perpetuate this. Just because every class of beginners has someone who thinks this is cool doesn't mean that it is worth bothering with. And you neither answered the question about what happens with non-integer variables nor demonstrated why you think the compiler doesn't generate a hidden third variable. If your trick doesn't work with non-integers (it doesn't), then the original question has not been answered. If the compiler might generate a hidden third variable, then the original question has not been answered.
.
- Follow-Ups:
- Re: brain teasers
- From: Daniel Rudy
- Re: brain teasers
- References:
- brain teasers
- From: viv342
- Re: brain teasers
- From: Martin Ambuhl
- Re: brain teasers
- From: rohitjogya@xxxxxxxxx
- brain teasers
- Prev by Date: Re: wctomb function for AVR
- Next by Date: Re: An interesting C problem
- Previous by thread: Re: brain teasers
- Next by thread: Re: brain teasers
- Index(es):