Does my AMD-based machine use little endian or big endian?

前端 未结 7 1011
鱼传尺愫
鱼传尺愫 2020-12-05 02:54

I\'m going though a computers system course and I\'m trying to establish, for sure, if my AMD based computer is a little endian machine? I believe it is because it

相关标签:
7条回答
  • 2020-12-05 03:21

    An easy way to know the endiannes is listed in the article Writing endian-independent code in C

    const int i = 1;
    #define is_bigendian() ( (*(char*)&i) == 0 )
    
    0 讨论(0)
提交回复
热议问题