C language operating system little or big endian judgment

 C language operating system little or big endian judgment

static unsigned int inline is_little_endian()
{
    union {
        char a;
        int  b;
    }t;

    t.b = 1;

    return (1 == t.a) ? 1 : 0;
}

Comments

Popular posts from this blog

Python Receiving and parse JSON Data via UDP protocol

ubus lua client method and event registration code demo/example