fork(2) download
  1. #include <stdio.h>
  2. int main (void)
  3. {
  4. long int i = 123;
  5. char *p = (char *) &i;
  6. if (*p == 123)
  7. {
  8. printf ("little endian\n");
  9. }
  10. else
  11. {
  12. printf ("big endian\n");
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
little endian