11-28-2008 06:27 AM
Let say I have:
char car=0xE2;
char str[10];
How do I put this value in string?
If I try:
sprintf(str,"%#x",car);
the result will be: 0xffffffe2
But I want to display only 0xe2.
How should I do it?
Thanks a lot
11-28-2008 07:08 AM
Hi,
Try :
sprintf(str,"%#x",(unsigned char)car);
B.W.
12-02-2008 04:47 AM
12-03-2008 12:54 PM
12-03-2008 02:59 PM
a consideration for C++ is indeed out of context... i was just pointing out the obvious error in the title of the thread.