Re: Lavorare con Shift,Bit,Maschera And or etc.
Von: Cybertoldo (cybertoldo@moc.liamg) [Profil]
Datum: 22.01.2007 15:00
Message-ID: <ep2g1v$apt$1@registered.motzarella.org>
Newsgroup: it.comp.lang.c
Datum: 22.01.2007 15:00
Message-ID: <ep2g1v$apt$1@registered.motzarella.org>
Newsgroup: it.comp.lang.c
cane ha scritto: > e in questo "ricettario": > > http://graphics.stanford.edu/~seander/bithacks.html ...carino questo link. Mi ha fatto anche ricordare un classico vecchio quiz che girava tra studenti o colleghi di lavoro: :) Swapping values with XOR #define SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) This is an old trick to exchange the values of the variables a and b without using extra space for a temporary variable. -- Cybertoldo Per rispondermi via email, sostituisci moc.liamg con gmail.com[ Auf dieses Posting antworten ]
Antworten
- yappo (23.01.2007 09:20)
- Legrandin (23.01.2007 22:29)
- Cybertoldo (24.01.2007 13:00)
- Costantino Grana (24.01.2007 15:46)
- Cybertoldo (24.01.2007 16:51)
- Salvatore Di Fazio (25.01.2007 09:32)
- Cybertoldo (25.01.2007 10:22)
- Salvatore Di Fazio (25.01.2007 10:39)
