_byteswap_uint64, _byteswap_ulong, _byteswap_ushort
Inverse l'ordre d'octets en un entier.
unsigned short _byteswap_ushort (
unsigned short val
);
unsigned long _byteswap_ulong (
unsigned long val
);
unsigned __int64 _byteswap_uint64 (
unsigned __int64 val
);
Paramètres
- val
L'entier pour inverser la marque d'ordre d'octet.
Configuration requise
routine |
en-tête requis |
---|---|
_byteswap_ushort |
<stdlib.h> |
_byteswap_ulong |
<stdlib.h> |
_byteswap_uint64 |
<stdlib.h> |
Pour plus d'informations de compatibilité, consultez compatibilité dans l'introduction.
Exemple
// crt_byteswap.c
#include <stdlib.h>
int main()
{
unsigned __int64 u64 = 0x0102030405060708;
unsigned long ul = 0x01020304;
printf("byteswap of %I64x = %I64x\n", u64, _byteswap_uint64(u64));
printf("byteswap of %Ix = %Ix", ul, _byteswap_ulong(ul));
}