http://blog.csdn.net/okadler0518/article/details/4962340ios
cout<<hex<<i<<endl; //輸出十六進制數
cout<<oct<<i<<endl; //輸出八進制數
cout<<dec<<i<<endl; //輸出十進制數spa
// 輸出16進制, setbase(int)能夠設置8等。.net
cout << setbase(16) << i << endl;code
http://bbs.csdn.net/topics/260000993blog
#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;
}