[[ blog 이사 과정에서 정확한 posting날짜가 분실됨. 년도와 분기 정도는 맞지 않을까? ]]
Let's remind about endianness.
big-endian : most significant byte first.
little-endian : least significant byte first.
How about following code?
UINT16 b; UINT8* p; p = &b; b = 0xABCD; printf("%x, %x\n", p[0], p[1]);
This make different result according to endianness.
LE : CD, AB
BE : AB, CD
So, avoid kind of coding!
'Language > C&C++' 카테고리의 다른 글
[C/C++] Use instantiate-function(factory function) to hide concreate class... (0) | 2007.12.13 |
---|---|
[C/C++] Case study! Bad example about ignoring data-align.. (0) | 2007.07.09 |
[C/C++] Sample! inter-change between endians... (0) | 2007.06.28 |
[C/C++] Avoiding symbol conflict when release library... (0) | 2007.05.19 |
[C/C++] Using 'virtual' and 'inline' keywords simultaneously. (0) | 2007.04.04 |