when endianess does matter – cast operations [duplicate]-Collection of common programming errors

Don’t forget that the compiler will only write assembly code. If you ignore all the warnings that the compiler, you can examine the assembly code produced by the compiler and figure out what really happens.

I took this simple program:


int main()
    unsigned endian[2] = { 0, 0 } ;
    long * casted_endian = reinterpret_cast( endian );

Originally posted 2013-11-09 19:44:15.