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. getchar ();
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 1724KB
stdin
Standard input is empty
stdout
little endian