pastebin

Paste Search Dynamic
Recent pastes
is big endian
  1. #include <stdio.h>
  2.  
  3. #include <stdint.h>
  4.  
  5. int is_big_endian(void)
  6. {
  7.         union {
  8.                 uint32_t i;
  9.                 char c[4];
  10.         } e = { 0x01000000 };
  11.  
  12.         return e.c[0];
  13. }
  14.  
  15. int main()
  16. {
  17.     printf("System is %s-endian.n",
  18.         is_big_endian() ? "big" : "little");
  19. }
  20.  
Parsed in 0.003 seconds