union daxiao { int a; char b; }; int main() { daxiao c; c.a = 1; cout << (c.b == 1) << endl; return 0; } 改成这样就行了,返回1是小端,0是大端
点赞 2

相关推荐

牛客网
牛客企业服务