Skip to content

TRUEANGLE

BEAUTY AND PLAY

  • GitLab
  • GitHub
  • Configuration
  • AI
  • BLOG
  • LINUX
  • ABOUT
    • ABOUT
    • Perception Style
    • Motivation
    • Telor

Tag Archives: little endian

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
October 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Aug    
TRUEANGLE, Proudly powered by WordPress.