- #include <iostream>
-
-
#include <fstream>
-
-
using namespace std;
-
-
-
-
int main()
-
-
{
-
-
-
-
unsigned char * array = new unsigned char[8];
-
-
-
-
-
-
array[0]=0x32;
-
-
cout << hex <<(int)array[0]<<" ";
-
-
-
-
for(int i=1;i<8;i++)
-
-
{
-
-
array[i]=array[i-1]+2;
-
-
cout <<hex<<(int)array[i]<< " ";
-
-
}
-
-
cout<<endl;
-
-
-
-
-
-
unsigned long long result;
-
-
unsigned long long result1;
-
-
unsigned long long result2;
-
-
-
-
cout << "array[0] >> 56 = " << (array[0] << 56) <<endl;
-
-
-
-
result1 = (array[0] <<24) ^ (array[1] <<16)^ (array[2] << 8) ^ array[3];
-
-
result2 = (array[4] <<24) ^ (array[5] <<16)^ (array[6] << 8) ^ array[7] ;
-
-
cout << result1 << endl;
-
-
cout << result2 << endl;
-
-
result = (result1<<32)^result2;
-
-
cout << dec <<(unsigned long long)result;
-
-
-
return 0;
-
}
output:
32 34 36 38 3a 3c 3e 40
array[0] >> 56 = 32000000
32343638
3a3c3e40
3617576015808446016
阅读(746) | 评论(0) | 转发(0) |