判断机器字节序大小端
#include <stdio.h>int main() {
int x = 0x1020304;
char* p = (char*)&x;
puts(p == 1 ? "Big endian" : "Little endian");
return 0;
}
┆凉┆暖┆降┆等┆幸┆我┆我┆里┆将┆┆可┆有┆谦┆戮┆那┆┆大┆始┆┆然┆
┆薄┆一┆临┆你┆的┆还┆没┆┆来┆┆是┆来┆逊┆没┆些┆┆雁┆终┆┆而┆
┆┆暖┆┆如┆地┆站┆有┆┆也┆┆我┆┆的┆有┆精┆┆也┆没┆┆你┆
┆┆这┆┆试┆方┆在┆逃┆┆会┆┆在┆┆清┆来┆准┆┆没┆有┆┆没┆
┆┆生┆┆探┆┆最┆避┆┆在┆┆这┆┆晨┆┆的┆┆有┆来┆┆有┆
┆┆之┆┆般┆┆不┆┆┆这┆┆里┆┆没┆┆杀┆┆来┆┆┆来┆
文档来源:51CTO技术博客https://blog.51cto.com/u_15310543/3163651
页:
[1]