Big Endian(大字節序)= (B0, B1, B2, B3) Little Endian(小字節序)= (B3, B2, B1, B0) Big Endian(大字節序)= (B0, B1, B2, B3, B4, B5, B6, B7) Little Endian(小字節序)= (B7, B6, B5, B4, B3, B2, B1, B0) #include
#include
int Func1(char *);
int main()
{
long arg, ret;
arg = 247;
ret = Func1((char *)&arg);
return(0);
}
int Func1(char * input)
{
int *tmp;
tmp = (int *)input;
return(*tmp);
}
typdef strUCt demo{
int i;
long j;
} DEMO;
DEMO test;
/*pout_raw輸出原始數據到一個文件中*/
/*輸出結構的每一個元素并避免了填充數據*/
pout_raw ((int) file_unit, (char *) test.i, sizeof (test.i));
pout_raw ((int) file_unit, (char *) test.j, sizeof (test.j));
/*下行包含了填充數據*/
pout_raw ((int) file_unit, (char *) test,sizeof(test)); % isainfo -v
64-bit sparcv9 applications
32-bit sparc applications warning: implicit function declaration: main
warning: argument does not match remembered type: arg #1
warning: passing 64-bit integer arg, eXPecting 32-bit integer:
MyProc(arg 7)
warning: assignment of 64-bit integer to 32-bit integer
warning: function argument ( number ) used inconsistently
warning: comparing 32-bit integer with 64-bit integer 新聞熱點
疑難解答