
On December 25, 2003 09:41 pm, Jing Su wrote:
I tried a short example, which seemed to work... snippet below. The only catch I found was I had to cast the number. I think the operator overload is sending the number into the character interpretor instead of the numeric interpretor.
std::cout << setw(2) << (unsigned int)std::hex << buf[i];
This gives me a long string of numbers starting with 134515590134515590....... The number sequense in buf[] is 01 00 00 00 5A FF 00 F0 C3 E2 This prints fine with printf( "%.2X ",buf[i]); I also tried a few other suggestins, given by by Peter Peres but also with negative success. It seems that the good old printf() is still the best to use. It just bugs me not being able to do it with cout. John -- The Toronto Linux Users Group. Meetings: http://tlug.ss.org TLUG requests: Linux topics, No HTML, wrap text below 80 columns How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml