Skip to content

TRUEANGLE

BEAUTY AND PLAY

  • DOLLECT
  • Others
  • Configuration
  • AI
  • BLOG
  • ABOUT
    • ABOUT
    • Perception Style

Tag Archives: big indian

How to write a program to find endianess of a machine ?

#include <stdio.h> #include <stdlib.h> static inline int little_endian() { int endian = 1; return (0 == (*(char *)&endian)); } int main (int argc, char **argv) { printf(“This machine is “); little_endian() ? printf(“little”) : printf(“big”); printf(” endian\n”); exit(0); }

Posted byjeffrinJuly 11, 2014Posted inC, operating system, Programming LanguagesTags: big indian, endianess, little endian
May 2026
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031
« Apr    
TRUEANGLE, Proudly powered by WordPress.