C > Miscellaneous
Show byte order, example
Show byte order, example #include
#include
int main(void) { u_int32_t x = 0x12345678; /* 305419896 */ unsigned char *xp = (char *)&x; printf("Endian: "); printf("%0x %0x %0x %0x\n", xp[0], xp[1], xp[2], xp[3]); return 0; }
C Codes
Beginners
C on Unix
Code Snippets
Data Structures
File Operations
Games Graphics
Gnu-Linux
Hardware
Mathematics
Miscellaneous
Small Programs
Sorting