_byteswap_uint64, _byteswap_ulong, _byteswap_ushort

정수에서 바이트의 순서를 반대로 바꿉니다.

구문

unsigned short _byteswap_ushort ( unsigned short val );
unsigned long _byteswap_ulong ( unsigned long val );
unsigned __int64 _byteswap_uint64 ( unsigned __int64 val );

매개 변수

val
바이트 순서를 반대로 바꿀 정수입니다.

요구 사항

루틴에서 반환된 값 필수 헤더
_byteswap_ushort <stdlib.h>
_byteswap_ulong <stdlib.h>
_byteswap_uint64 <stdlib.h>

호환성에 대한 자세한 내용은 호환성을 참조하세요.

예시

// 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));
}
byteswap of 0102030405060708 = 0807060504030201
byteswap of 01020304 = 04030201

참고 항목

범주별 유버니설 C 런타임 루틴