Endian的判断和转换 1.判断当前CPU使用哪种C++ Endian?2.如果当前数据的Endian和当前CPU相反,如何装换?代码相当直观:1.判断CPU的C++ Endian:union { short s; char c[sizeof(short)]; } un; un.s = 0x0102; _isLittleEnd = (un.c[0] == 0x2); C++技术 2023-11-28 36 点赞 0 评论 54 浏览