Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::format, print hex
From: Eric J. Holtman (eric_at_[hidden])
Date: 2010-07-09 11:22:53


On 7/9/2010 10:09 AM, Lloyd wrote:
> changing int to simpe "unsigned char" did not work (It prints '0-').
> I changed it to
>
> ss<<boost::format("%|02X|")%(int)(unsigned char)(a[0]);
>
> Now it works. But looks dirty, is it the right way?
>

Change the declaration of a from

char a[10];

to

unsigned char a[10];


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net