今天在上看到的 自己改进了一下发出来

小端输出1 大端输出0


union
{
  int i;
  char c[4];
} test;
test.i = 1;
cout << int(test.c[0]) << endl;