C Codes
Beginners
C on Unix
Code Snippets
Data Structures
File Operations
Games Graphics
Gnu-Linux
Hardware
Mathematics
Miscellaneous
Small Programs
Sorting
C > Miscellaneous sample source codes
Show byte order, example
Show byte order, example #include <stdio.h> #include <sys/types.h> 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; }
Privacy Policy
|
Link to Us
|
Links