判断大小端:
#include <stdio.h>
int main()
{
int a=0x11223344;
char *s = (char*)&a;
if(s[0] == 0x11)
printf("L /n");
else
printf("B /n");
}
判断大小端:
#include <stdio.h>
int main()
{
int a=0x11223344;
char *s = (char*)&a;
if(s[0] == 0x11)
printf("L /n");
else
printf("B /n");
}