http://blog.csdn.net/okadler0518/article/details/4962340
cout<<hex<<i<<endl; //输出十六进制数
cout<<oct<<i<<endl; //输出八进制数
cout<<dec<<i<<endl; //输出十进制数
// 输出16进制, setbase(int)可以设置8等。
cout << setbase(16) << i << endl;
http://bbs.csdn.net/topics/260000993
#include <iostream>
using
namespace
std;
int
main(
void
)
{
char
data[8] = {0x68,0x04, 0x43,0x00,0x00,0x00};
for
(
int
i=0;i<8;i++)
{
cout << hex << data[i] << endl;
}
return
0;
}