[ create a new paste ] login | about

Link: http://codepad.org/Abe4VgIo    [ raw code | output | fork ]

appunti2 - C, pasted on Apr 30:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
int main (void)
{
    long int i = 123;
    char *p = (char *) &i;
    if (*p == 123)
      {
        printf ("little endian\n");
      }
    else
      {
        printf ("big endian\n");
      }
    return 0;
}


Output:
1
little endian


Create a new paste based on this one


Comments: