[Dev-C++] Convert Little-Endian to Big-Endian (and vice versa)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Joey D. <jda...@ya...> - 2004-11-11 04:54:16
|
Hello, Does anybody know a faster algorithm to swap the bytes of an 'unsigned long' than this: // SWAP 32-BITS #define SWAP_LONG( A ) ((A << 24) | ((A & 0xff00L) << 8 ) | ((A & 0xff0000L) >> 8 ) | ((unsigned long)A >> 24)) Thank You. Joey --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now |