Hacker News new | ask | show | jobs
by tlrobinson 6637 days ago

    printf("%hx", *(unsigned short *)"YC");
...works on big endian machines. this works everywhere:

    printf("%hx", htons(*(unsigned short *)"YC"));