#include <iostream>
using namespace std;
bool isBig_Endian(){
unsigned short test = 0x1122;
int i = 0;
if(*(( unsigned char *) & test) == 0x11){
i = 1;
cout << "这个是小段" << endl;
}
else{
i = 0;
cout << "这个是大端" << endl;
}
cout << i << endl;
return i;
}
int main() {
cout << isBig_Endian() << endl;
}
C 语言判断大端小端
最新推荐文章于 2024-04-18 22:28:53 发布