티스토리 뷰
#include <stdio.h>
int main(){
int i = 0x1213456789;
char* p = (char *)&i;
printf("%x\n", *p);
if (*p == (char)0x00000089)
printf("little endian\n");
else
printf("big endian\n");
return 0;
}
'C, C++' 카테고리의 다른 글
[C++] DayTime server/client (0) | 2020.03.11 |
---|---|
[C++] TCP socket_file descriptor, text file descriptor (0) | 2020.03.11 |